The Apache settings of SuSE-Linux Enterprise Application-Linux server application information. The following is a detailed description. Apache needs to be set as a virtual website space because of its working relationship.
The new version of SuSE Apache has been changed to Modular
Therefore, you only need to modify a few files so that when you create an account, the website will be directed to the corresponding location.
Instead of modifying the location of the corresponding/home in the http. conf file, you need to restart the Apache
Very convenient ^ The configuration begins to be set below
1. Modify/etc/sysconfig/apache2
] # Vi/etc/sysconfig/apache2
Find APACHE_MODULES
Add vhost_alias to the end
Archive and recompile the apach2 configuration file to load apache2 to the vhost module.
] # SuSEconfig -- module apache2
2. Create a new file named vhost. conf in/etc/apache2/vhosts. d/as follows:
] # Vi/etc/apache2/vhosts. d/vhost. conf
UseCanonicalName Off
ErrorLog/var/log/apache2/error_log
CustomLog/var/log/apache2/access_log common
VirtualDocumentRoot/home/vhost/% 0/public_html
VirtualScriptAlias/home/vhost/% 0/public_html/cgi-bin
AddHandler cgi-script. cgi
Options ExecCGI
SetHandler cgi-script
The red area varies according to your preferences.
Default Value:/home/% 0/public_html
/There is no "vhost" behind home, so the younger brother creates more directories for ease of management.
In this way, home looks clean.
3. Modify default-server.conf
Vi default-server.conf
Find ScriptAlias XXXXXX
Comment out this section
# ScriptAlias/cgi-bin/"/srv/www/cgi-bin /"
# "/Srv/www/cgi-bin" shocould be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
#
# AllowOverride None
# Options + ExecCGI-Includes
# Order allow, deny
# Allow from all
#
Not many directories are created.
Here, apache2 restart is OK and the following 4 actions are skipped.
4. If you create more layers, modify mod_userdir.conf.
] # Vi mod_userdir.conf
Find
Change
Archive exit
5. Restart apache2
] # Rcapache2 restart
Create a website later
When you create a new USER
The domain method is built directly in the home directory.
For example
Abc user: his home directory is/home/vhost/www.xyz.com
Apache will automatically go to/home/vhost/www.xyz.com/public_html/
The website information is read in the directory.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.