====== 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:
ListenBacklog 511
ServerLimit 5
MaxClients 5
===== Virtual Hosts =====
To set up multiple web servers on a same host, listening on different ports, set the Apache configuration as follows:
* Listen : -> put as many such lines as necessary (one for each port)
* Port 80 -> the default port to listen to
* DocumentRoot /foo/bar -> the path of files for the default port
* -> describe options for the default document root path
*
* NameVirtualHost : -> this defines another 'web' on another port
Port 8000
===== User directories =====
To enable Apache user directories, see [[http://www.apachefriends.org/f/viewtopic.php?t=23391|this thread]]: in file /opt/lampp/etc/httpd.config
If you're using LAMPP, uncomment this line which begins with Include like so:
# User home directories
Include /etc/extra/httpd-userdir.conf
After the for the box that begins with add these lines:
#
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
#
UserDir Sites
To authorize web pages for users, use mod_userdir.
===== 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)
# aptitude install apache php5 libapache-mod-php5
# dpkg-reconfigure apache
# aptitude install php5-sqlite
==== 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:
LoadModule php5_module libexec/libphp5.so
php_value include_path ".:/usr/local/php/lib"
php_admin_flag safe_mode on ===> or off for some wikis
* Later in that file, add:
# Tell Apache to parse certain extensions as PHP
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
====== 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)
cd phpMyAdmin
mkdir config
chmod o+rw config
cp config.inc.php config
chmod o+w config/config.inc.php
Open scripts/setup.php in the browser. User & password must match something MySQL knows.
mv config/config.inc.php .
chmod o-w config.inc.php
Try in your browser: .../phpMyAdmin/index.php : you should be able to log into the database.
====== ProFTPD ======
If you're using LAMPP, the root directory has been modified to /opt/lampp/ftproot.
In /etc/ftpusers, enter users NOT allowed to do ftp. Typically system accounts. To have ProFTPD use this file, make sure the option is enabled in proftpd.conf:
UseFtpUsers on
If FTP is slow, check ReverseDNS is disabled. You should have this in proftpd.conf:
IdentLookups off
UseReverseDNS off
====== XAMPP ======
An alternative to installing Apache, PHP, MySQL (etc) consists in using XAMPP, an all-in-one preconfigured package.
XAMPP is available for Windows and for Linux where it is called LAMPP. **It does not compile for Solaris 10.**
It is typically installed in /opt/lampp and the daemon can be controlled using the command **./lampp start**
or stop, restart...
To harden LAMPP's security, run : **/lampp security**
Configuration of the Apache, ProFTPD (etc) servers are in etc.
====== Samba ======
^ OS ^ Packages ^ Services ^ Default location for smb.conf ^
| Debian | samba, smbclient | /etc/init.d/samba start | |
| 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 =====
==== Sample configuration file ====
[global]
server string = Boureautic Samba Server
security = SHARE
log file = /var/samba/log/log.%m
max log size = 50
dns proxy = No
read only = No
hosts allow = 192.168.0., 127.
[homes]
comment = Home Directories
browseable = No
[sauvegardes]
comment = Repertoires de sauvegardes sur Boureautic
path = /mnt/win_e/sauvegardes
guest ok = Yes
==== See where Samba reads its configuration file from ====
smbd -b | grep conf
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:
[share]
...
guest ok = Yes
...
[global]
read only = No
security = SHARE
==== User security settings ====
If user per-user security settings, you must first set passwords using smbpasswd:
smbpasswd -a -U
smbpasswd is located in /usr/sfw/bin for Solaris 10.
==== Validate smb.conf ====
To test your smb.conf file, use **testparm **.
testparm is located in /usr/sfw/bin for Solaris 10.
===== smbclient =====
* Find out what shares are available on a given host:
smbclient -L hostname -I
* access a given share:
smbclient //hostsname/share-U yz -I
or
smbclient \\\\hostname\\sharename
===== smbfs =====
To mount a share as a filesystem:
On Linux,
mount -t smbfs -o username=yzo,password=xxx,ip= //host/share /mnt/point
On OpenSolaris,
modload -p drv/nsmb
modload -p fs/smbfs
devfsadm -i nsmb
pfexec mount -f smbfs //server/share /mntpoint
Password:
===== SWAT =====
To disable SWAT on Debian:
- disable localhost:901, in/etc/inetd.conf,
- then kill -1 inetd to restart.
To disable SWAT on OpenSolaris: stop the svc:/network/swat:default service :
svcadm disable svc:/network/swat:default