A detailed explanation of the Apache configuration steps in Linux openSUSE

Source: Internet
Author: User

DNS binding A Record #

First, a record is created on DNS, and the domain name is bound to the corresponding IP.
Create a Site Directory #

On the server, add the/srv/www/vhosts/www.111cn.net directory and create a index.html file in the directory – for testing.
Configure apache#

Create a virtual host configuration file #

The code is as follows Copy Code
$ cd/etc/apache2/vhosts.d
$ sudo cp vhost.template www.111cn.net.conf

The contents of the modified Www.111cn.net.conf file are as follows:

The code is as follows Copy Code

<virtualhost *:80>
ServerName www.111cn.net
ServerAdmin chenxsan@gmail.com

Documentroot/srv/www/vhosts/www.111cn.net

Errorlog/var/log/apache2/www.111cn.net-error_log
Customlog/var/log/apache2/www.111cn.net-access_log combined

# don ' t loose time with IP address lookups
Hostnamelookups off

# needed for named virtual hosts
Usecanonicalname off

# Configures the footer on server-generated documents
Serversignature on

#
# This should is changed to whatever your set DocumentRoot to.
#
<directory "/srv/www/vhosts/www.111cn.net" >
AllowOverride All
Options FollowSymLinks

Order Allow,deny
Allow from all

</Directory>

</VirtualHost>

Then restart Apache:

$ sudo rcapache2 restart

Access to the Www.111cn.net URL, you can already see the contents of the index.html file. If we have not added index.html files before, we will receive the following error message:
Access forbidden!
You are don ' t have permission to access the requested directory. There is either no index document or the directory is read-protected.
If You are a server error, please contact the webmaster.
Error 403
www.111cn.net

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.