This shows you the differences between two versions of the page.
tools:web [2009/01/05 21:48] 127.0.0.1 external edit |
tools:web [2009/02/28 15:21] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Apache ====== | ====== Apache ====== | ||
+ | |||
+ | ^ Item ^ Solaris 10 ^ OpenSolaris 2008.11 ^ | ||
+ | | Name | Apache2 | Apache 2.2 | | ||
+ | | Start Apache | svcadm enable apache2 | svcadm enable apache22 | | ||
+ | | Restart Apache | svcadm restart apache2 | svcadm restart apache22 | | ||
+ | | Default location for web pages | /var/apache2/htdocs | /var/apache2/2.2/htdocs | | ||
+ | | Default configuration file | /etc/apache2/httpd.conf (copied from /etc/apache2/httpd.conf-example) | /etc/apache2/2.2/httpd.conf | | ||
+ | |||
+ | * edit /etc/apache2/httpd.conf (in particular ServerName) | ||
+ | * to have the web server automatically load / understand index.php files, add index.php to DirectoryIndex option. | ||
+ | * tune the number of servers and clients: | ||
+ | <code> | ||
+ | <IfModule prefork.c> | ||
+ | ListenBacklog 511 | ||
+ | ServerLimit 5 | ||
+ | MaxClients 5 | ||
+ | </IfModule> | ||
+ | </code> | ||
===== Virtual Hosts ===== | ===== Virtual Hosts ===== | ||
Line 37: | Line 55: | ||
UserDir Sites | UserDir Sites | ||
</IfModule> | </IfModule> | ||
- | <code> | + | </code> |
To authorize web pages for users, use mod_userdir. | To authorize web pages for users, use mod_userdir. | ||
+ | |||
===== PHP ===== | ===== PHP ===== | ||
+ | |||
+ | ^ Solaris 10 ^ OpenSolaris 2008.11 ^ Debian ^ Ubuntu ^ | ||
+ | | Get [[http://www.sunfreeware.com|Php from sunfreeware]] | Not tried | Packages: php5 libapache-mod-php5 php5-sqlite | Not tried | | ||
+ | |||
+ | ==== PHP: Debian Installation Tips ==== | ||
To support PHP5 on Apache, do the following on Linux (Debian) | To support PHP5 on Apache, do the following on Linux (Debian) | ||
Line 49: | Line 73: | ||
# aptitude install php5-sqlite | # aptitude install php5-sqlite | ||
</code> | </code> | ||
+ | |||
+ | ==== PHP: Solaris Installation Tips ==== | ||
+ | |||
+ | Sunfreeware's package installs in /usr/local/php. | ||
+ | |||
+ | * Link /usr/apache2/libexec/libphp5.so to /usr/local/apache2/modules/libphp5.so | ||
+ | * Edit /etc/apache2/httpd.conf. Add the following: | ||
+ | <code> | ||
+ | LoadModule php5_module libexec/libphp5.so | ||
+ | <IfModule mod_php5.c> | ||
+ | php_value include_path ".:/usr/local/php/lib" | ||
+ | php_admin_flag safe_mode on ===> or off for some wikis | ||
+ | </IfModule> | ||
+ | </code> | ||
+ | * Later in that file, add: | ||
+ | <code> | ||
+ | # Tell Apache to parse certain extensions as PHP | ||
+ | AddType application/x-httpd-php .php .phtml | ||
+ | AddType application/x-httpd-php-source .phps | ||
+ | </code> | ||
+ | |||
+ | |||
+ | |||
+ | ====== MySQL ====== | ||
+ | |||
+ | ^ Solaris ^ OpenSolaris 2008.11 ^ Debian ^ Ubuntu ^ | ||
+ | | Get it from [[http://dev.mysql.com/downloads/mysql/5.0.html#downloads|MySQL's web site]] or - easier - a pre-compiled binary from [[http://www.sunfreeware.com/|SunFreeware.com]]. The former installs in /opt/mysql by default, whereas the latter installs in /usr/local/mysql.| Not tried || Yes | | ||
+ | |||
+ | * Create a mysql user and group: groupadd mysql && useradd -g mysql mysql | ||
+ | * Run the install database script: bin/mysql_install_db --user=mysql | ||
+ | * Copy configuration file from share/mysql/my_medium.cnf to /etc/my.cnf | ||
+ | * Launch MySQL with bin/mysqld_safe & | ||
+ | * Automatic launching: copy share/mysql/mysql.server to /etc/init.d, then link /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql. In that script, set the basedir to /usr/local/mysql and the datadir to /usr/local/mysql/var | ||
+ | |||
+ | ====== PhpMyAdmin ====== | ||
+ | |||
+ | Unzip [[http://www.phpmyadmin.net/|PhpMyAdmin]] in the web server's root (for example, on Solaris: /var/apache2/htdocs) | ||
+ | <code> | ||
+ | cd phpMyAdmin | ||
+ | mkdir config | ||
+ | chmod o+rw config | ||
+ | cp config.inc.php config | ||
+ | chmod o+w config/config.inc.php | ||
+ | </code> | ||
+ | Open scripts/setup.php in the browser. User & password must match something MySQL knows. | ||
+ | <code> | ||
+ | mv config/config.inc.php . | ||
+ | chmod o-w config.inc.php | ||
+ | </code> | ||
+ | Try in your browser: .../phpMyAdmin/index.php : you should be able to log into the database. | ||
====== ProFTPD ====== | ====== ProFTPD ====== | ||
Line 79: | Line 153: | ||
====== Samba ====== | ====== Samba ====== | ||
- | ^ OS ^ Packages ^ | + | ^ OS ^ Packages ^ Services ^ Default location for smb.conf ^ |
- | | Debian | samba, smbclient | | + | | Debian | samba, smbclient | /etc/init.d/samba start | | |
- | | Solaris | installed by default | | + | | Solaris | installed by default | | /etc/sfw/smb.conf | |
+ | | OpenSolaris | installed by default | svc:/network/samba:default, svc:/network/winbind:default, svc:/network/wins:default, svc:/network/swat:default | | | ||
- | Configuration file is smb.conf. | + | ===== Configuration file ===== |
+ | |||
+ | ==== Sample configuration file ==== | ||
<code> | <code> | ||
[global] | [global] | ||
Line 97: | Line 174: | ||
comment = Home Directories | comment = Home Directories | ||
browseable = No | browseable = No | ||
+ | |||
[sauvegardes] | [sauvegardes] | ||
Line 103: | Line 181: | ||
guest ok = Yes | guest ok = Yes | ||
</code> | </code> | ||
+ | |||
+ | ==== See where Samba reads its configuration file from ==== | ||
+ | <code> | ||
+ | smbd -b | grep conf | ||
+ | </code> | ||
+ | |||
+ | smbd is located in /usr/sfw/bin for Solaris 10. | ||
+ | |||
+ | ==== Share a mount point without any password ==== | ||
To share a mount point with a host running Windows without any password: | To share a mount point with a host running Windows without any password: | ||
Line 115: | Line 202: | ||
</code> | </code> | ||
- | To test your smb.conf file, use **testparm <smb.conf file>**. | + | ==== User security settings ==== |
If user per-user security settings, you must first set passwords using smbpasswd: | If user per-user security settings, you must first set passwords using smbpasswd: | ||
Line 122: | Line 209: | ||
</code> | </code> | ||
- | * run samba with **/etc/init.d/samba start** (use stop to stop !) | + | smbpasswd is located in /usr/sfw/bin for Solaris 10. |
- | * to see where Samba reads its configuration from do: **smbd -b | grep conf** | + | |
+ | ==== Validate smb.conf ==== | ||
+ | |||
+ | To test your smb.conf file, use **testparm <smb.conf file>**. | ||
+ | |||
+ | testparm is located in /usr/sfw/bin for Solaris 10. | ||
+ | |||
+ | |||
+ | ===== smbclient ===== | ||
* Find out what shares are available on a given host: | * Find out what shares are available on a given host: | ||
Line 137: | Line 232: | ||
smbclient \\\\hostname\\sharename | smbclient \\\\hostname\\sharename | ||
</code> | </code> | ||
- | * mount a share as a filesystem: LINUX ONLY. | + | |
+ | ===== smbfs ===== | ||
+ | |||
+ | To mount a share as a filesystem: | ||
+ | |||
+ | On Linux, | ||
<code> | <code> | ||
mount -t smbfs -o username=yzo,password=xxx,ip=<IP address> //host/share /mnt/point | mount -t smbfs -o username=yzo,password=xxx,ip=<IP address> //host/share /mnt/point | ||
</code> | </code> | ||
- | * Disable SWAT: disable localhost:901, in/etc/inetd.conf, then kill -1 inetd to restart. | + | On OpenSolaris, |
+ | <code> | ||
+ | modload -p drv/nsmb | ||
+ | modload -p fs/smbfs | ||
+ | devfsadm -i nsmb | ||
+ | pfexec mount -f smbfs //server/share /mntpoint | ||
+ | Password: | ||
+ | </code> | ||
- | ====== MySQL ====== | + | ===== SWAT ===== |
- | * Create a mysql user and group: groupadd mysql && useradd -g mysql mysql | + | To disable SWAT on Debian: |
- | * Run the install database script: bin/mysql_install_db --user=mysql | + | - disable localhost:901, in/etc/inetd.conf, |
- | * Copy configuration file from share/mysql/my_medium.cnf to /etc/my.cnf | + | - then kill -1 inetd to restart. |
- | * Launch MySQL with bin/mysqld_safe & | + | |
- | * Automatic launching: copy share/mysql/mysql.server to /etc/init.d, then link /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql. In that script, set the basedir to /usr/local/mysql and the datadir to /usr/local/mysql/var | + | |
- | ====== MediaWiki ====== | + | To disable SWAT on OpenSolaris: stop the svc:/network/swat:default service : |
- | + | ||
- | Unzip the package somewhere in the web server's directory (/var/apache2/htdocs) | + | |
<code> | <code> | ||
- | chmod a+w config | + | svcadm disable svc:/network/swat:default |
</code> | </code> | ||
- | * open in your browser the setup script (config/index.php) | + | |
- | * make sure to create a MySQL user with SELECT, INSERT, UPDATE, DELETE and CREATE privileges. | + | |
- | * mv config/LocalSettings.php to .. : beware that file contains cleartext passwords. | + | |
- | * The problem with Mediawiki is that I find it a bit slow for the very simple usage I need it for. | + | |
- | So, actually, I use DokuWiki. That wiki does not need MySQL. | + | |