WOONO's Blog





General machine setup

Configure your network and make sure that all components are current, by running YaST Online Update regularly. Parts of the HTTP protocol depend on correct time. Configure machine as a NTP client, either with the YaST configuration module or by editing /etc/ntp.conf (just put a server name into it) and running

rcntp start
chkconfig -a ntp

 
Installation of Apache packagesInstall the package or the complete LAMP server pattern.

zypper in apache2
zypper in -t pattern lamp_server


Firewall

If you run a firewall, make sure to allow access to HTTP(s) ports if the server should be reachable from other machines. The supplied configurations are called apache2 and apache2-ssl. They can be enabled via YaST, by adding them to FW_CONFIGURATIONS_EXT in /etc/sysconfig/SuSEfirewall2 or issuing these commands:

sysconf_addword /etc/sysconfig/SuSEfirewall2 FW_CONFIGURATIONS_EXT apache2
sysconf_addword /etc/sysconfig/SuSEfirewall2 FW_CONFIGURATIONS_EXT apache2-ssl
rcSuSEfirewall2 restart 

Starting the server
Start the server and configure it to automatically start at boot time.

rcapache2 start
chkconfig -a apache2

 

Adding web pages

The default DocumentRoot is at /srv/www/htdocs, put the files there.

Apache Modules

Enable required Apache Modules by editing APACHE_MODULES in /etc/sysconfig/apache2. Modules can be enabled/disabled/listed with the commands below. Any such operation requires a restart of the service.

a2enmod php5
a2dismod perl
a2enmod -l
/etc/init.d/apache restart

 

Custom configuration

Add/edit configuration for all virtual hosts to /etc/apache2/default-server.conf. Edit APACHE_CONF_INCLUDE_FILES in /etc/sysconfig/apache2 to include configurations from external files. To understand the hierarchy and layout of all include files, read the comments at the top of httpd.conf The old, single, 40K, monolithic configuration file is available in /usr/share/doc/packages/apache2/httpd-std.conf-prefork.

Troubleshooting

Read any error messages when you start the service. Reproduce what is not working and see how it is reflected in thelogs. The log files can be monitored in a root shell:
 

tail -F /var/log/apache2/*

If you suspect a bug, please report it.
http Server Gui Install
 

zypper in yast2-http-server


Posted by woono