Organizational Research By

Surprising Reserch Topic

Question:how to Apache HTTP Web server configuration:



asked Sep 13, 2013 in LINUX by anonymous
edited Sep 12, 2013
0 votes
20 views



Related Hot Questions

2 Answers

0 votes

 

Apache HTTP Web server configuration:
 
This tutorial is for the Apache HTTP web server (Version 1.3 and 2.0). See the YoLinux list of Linux HTTP servers for a list of other web servers for the Hyper Text Transport Protocol.
 
The Apache web server configuration file is: /etc/httpd/conf/httpd.conf
 
Web pages are served from the directory as configured by the DocumentRoot directive. The default directory location is:
 
    Linux distribution Apache web server "DocumentRoot"
    Red Hat 7.x-9, Fedora Core, Red Hat Enterprise 4/5/6, CentOS 4/5/6 /var/www/html/
    Red Hat 6.x and older /home/httpd/html/
    Suse 9.x /srv/www/htdocs/
    Ubuntu (dapper 6.06) / Debian /var/www/html
    Ubuntu (hardy 8.04/natty 11.04) / Debian /var/www
 
The default home page for the default configuration is index.html. Note the pages should not be owned by user apache as this is the process owner of the httpd web server daemon. If the web server process is comprimised, it should not be allowed to alter the files. The files should of course be readable by user apache.
 
Apache may be configured to run as a host for one web site in this fashion or it may be configured to serve for multiple domains. Serving for multiple domains may be achieved in two ways:
 
    Virtual hosts: One IP address but multiple domains - "Name based" virtual hosting.
    Multiple IP based virtual hosts: One IP address for each domain - "IP based" virtual hosting.
 
The default configuration will allow one to have multiple user accounts under one domain by using a reference to the user account: http://www.domain.com/~user1/. If no domain is registered or configured, the IP address may also be used: http://XXX.XXX.XXX.XXX/~user1/.
 
[Potential Pitfall] The default umask for directory creation is correct by default but if not use: chmod 755 /home/user1/public_html
 
[Potential Pitfall] When creating new "Directory" configuration directives, I found that placing them by the existing "Directory" directives to be a bad idea. It would not use the .htaccess file. This was because the statement defining the use of the .htaccess file was after the "Directory" statement. Previously in RH 6.x the files were separated and the order was defined a little different. I now place new "Directory" statements near the end of the file just before the "VirtualHost" statements.
 
For users of Red Hat 7.1, the GUI configuration tool apacheconf was introduced for the crowd who like to use pretty point and click tools.
 
Files used by Apache:
 
    Start/stop/restart script:
        Red Hat/Fedora/CentOS: /etc/rc.d/init.d/httpd
        SuSE 9.3: /etc/init.d/apache2
        Ubuntu (dapper 6.06/hardy 8.04/natty 11.04) / Debian: /etc/init.d/apache2
    Apache main configuration file:
        Red Hat/Fedora/CentOS: /etc/httpd/conf/httpd.conf
        SuSE: /etc/apache2/httpd.conf
        (Need to add directive: ServerName host-name)
        Ubuntu (dapper 6.06/hardy 8.04/natty 11.04) / Debian: /etc/apache2/apache2.conf
    Apache suplementary configuration files:
        Red Hat/Fedora/CentOS: /etc/httpd/conf.d/component.conf
        SuSE: /etc/apache2/conf.d/component.conf
        Ubuntu (dapper 6.06/hardy 8.04/natty 11.04) / Debian:
            Virtual domains: /etc/apache2/sites-enabled/domain
            (Create soft link from /etc/apache2/sites-enabled/domain to /etc/apache2/sites-available/domain to turn on. Use command a2ensite)
            Additional configuration directives: /etc/apache2/conf.d/
            Modules to load: /etc/apache2/mods-available/
            (Soft link to /etc/apache2/mods-enabled/ to turn on)
            Ports to listen to: /etc/apache2/ports.conf
    /var/log/httpd/access_log and error_log - Red Hat/Fedora Core Apache log files
    (Suse: /var/log/apache2/)
 
answered Sep 13, 2013 by anonymous
edited Sep 12, 2013
0 votes

 

Apache HTTP Web server configuration:
 
This tutorial is for the Apache HTTP web server (Version 1.3 and 2.0). See the YoLinux list of Linux HTTP servers for a list of other web servers for the Hyper Text Transport Protocol.
 
The Apache web server configuration file is: /etc/httpd/conf/httpd.conf
 
Web pages are served from the directory as configured by the DocumentRoot directive. The default directory location is:
 
    Linux distribution Apache web server "DocumentRoot"
    Red Hat 7.x-9, Fedora Core, Red Hat Enterprise 4/5/6, CentOS 4/5/6 /var/www/html/
    Red Hat 6.x and older /home/httpd/html/
    Suse 9.x /srv/www/htdocs/
    Ubuntu (dapper 6.06) / Debian /var/www/html
    Ubuntu (hardy 8.04/natty 11.04) / Debian /var/www
 
The default home page for the default configuration is index.html. Note the pages should not be owned by user apache as this is the process owner of the httpd web server daemon. If the web server process is comprimised, it should not be allowed to alter the files. The files should of course be readable by user apache.
 
Apache may be configured to run as a host for one web site in this fashion or it may be configured to serve for multiple domains. Serving for multiple domains may be achieved in two ways:
 
    Virtual hosts: One IP address but multiple domains - "Name based" virtual hosting.
    Multiple IP based virtual hosts: One IP address for each domain - "IP based" virtual hosting.
 
The default configuration will allow one to have multiple user accounts under one domain by using a reference to the user account: http://www.domain.com/~user1/. If no domain is registered or configured, the IP address may also be used: http://XXX.XXX.XXX.XXX/~user1/.
 
[Potential Pitfall] The default umask for directory creation is correct by default but if not use: chmod 755 /home/user1/public_html
 
[Potential Pitfall] When creating new "Directory" configuration directives, I found that placing them by the existing "Directory" directives to be a bad idea. It would not use the .htaccess file. This was because the statement defining the use of the .htaccess file was after the "Directory" statement. Previously in RH 6.x the files were separated and the order was defined a little different. I now place new "Directory" statements near the end of the file just before the "VirtualHost" statements.
 
For users of Red Hat 7.1, the GUI configuration tool apacheconf was introduced for the crowd who like to use pretty point and click tools.
 
Files used by Apache:
 
    Start/stop/restart script:
        Red Hat/Fedora/CentOS: /etc/rc.d/init.d/httpd
        SuSE 9.3: /etc/init.d/apache2
        Ubuntu (dapper 6.06/hardy 8.04/natty 11.04) / Debian: /etc/init.d/apache2
    Apache main configuration file:
        Red Hat/Fedora/CentOS: /etc/httpd/conf/httpd.conf
        SuSE: /etc/apache2/httpd.conf
        (Need to add directive: ServerName host-name)
        Ubuntu (dapper 6.06/hardy 8.04/natty 11.04) / Debian: /etc/apache2/apache2.conf
    Apache suplementary configuration files:
        Red Hat/Fedora/CentOS: /etc/httpd/conf.d/component.conf
        SuSE: /etc/apache2/conf.d/component.conf
        Ubuntu (dapper 6.06/hardy 8.04/natty 11.04) / Debian:
            Virtual domains: /etc/apache2/sites-enabled/domain
            (Create soft link from /etc/apache2/sites-enabled/domain to /etc/apache2/sites-available/domain to turn on. Use command a2ensite)
            Additional configuration directives: /etc/apache2/conf.d/
            Modules to load: /etc/apache2/mods-available/
            (Soft link to /etc/apache2/mods-enabled/ to turn on)
            Ports to listen to: /etc/apache2/ports.conf
    /var/log/httpd/access_log and error_log - Red Hat/Fedora Core Apache log files
    (Suse: /var/log/apache2/)
 
answered Sep 13, 2013 by anonymous
edited Sep 12, 2013

...