This is an old revision of the document!


Apache

Virtual Hosts

To set up multiple web servers on a same host, listening on different ports, set the Apache configuration as follows:

  • Listen <IP address>:<port> → 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
  • <Directory /foo/bar> → describe options for the default document root path
  • </Directory>
  • NameVirtualHost <IP address>:<port> → this defines another 'web' on another port
<VirtualHost IP address:8000>
Port 8000
</VirtualHost> 

User directories

To enable Apache user directories, see 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 <InstallDir>/etc/extra/httpd-userdir.conf

After the </Directory> for the box that begins with <Directory ”/opt/lampp/xamppfiles/htdocs> add these lines:

#
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
#
<IfModule mod_userdir.so>
UserDir Sites
</IfModule> 
<code>

To authorize web pages for users, use mod_userdir.

===== PHP =====

To support PHP5 on Apache, do the following on Linux (Debian)
<code>
# aptitude install apache php5 libapache-mod-php5
# dpkg-reconfigure apache
# aptitude install php5-sqlite

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 <installdir>./lampp start or stop, restart…

To harden LAMPP's security, run : <installdir>/lampp security

Configuration of the Apache, ProFTPD (etc) servers are in etc.

Samba

OS Packages
Debian samba, smbclient
Solaris installed by default

Configuration file is smb.conf.

[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

To share a mount point with a host running Windows without any password:

[share]
...
guest ok = Yes
...
[global]
read only = No
security = SHARE

To test your smb.conf file, use testparm <smb.conf file>.

If user per-user security settings, you must first set passwords using smbpasswd:

smbpasswd -a -U <username>
  • run samba with /etc/init.d/samba start (use stop to stop !)
  • to see where Samba reads its configuration from do: smbd -b | grep conf
  • Find out what shares are available on a given host:
smbclient -L hostname -I <IP address>
  • access a given share:
smbclient //hostsname/share-U yz -I <IP address>

or

smbclient \\\\hostname\\sharename
  • mount a share as a filesystem: LINUX ONLY.
mount -t smbfs -o username=yzo,password=xxx,ip=<IP address> //host/share /mnt/point
  • Disable SWAT: disable localhost:901, in/etc/inetd.conf, then kill -1 inetd to restart.

MySQL

  • 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

MediaWiki

Unzip the package somewhere in the web server's directory (/var/apache2/htdocs)

chmod a+w config
  • 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.

 
Back to top
tools/web.1231188494.txt.gz · Last modified: 2009/02/21 21:10 (external edit)
 
 
Get OpenSolaris Recent changes RSS feed Valid XHTML 1.0 Driven by DokuWiki chimeric.de = chi`s home
(c) A. Apvrille - 2009