Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set up Apache virtual website under SuSE Linux operating system

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Today, I will talk to you about how to set up the Apache virtual website under the SuSE Linux operating system. Many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.

This lecture needs to be set as the Apache virtual website space mode. I like to set up the Apache virtual website space very much, and I also like to summarize the experiences and lessons about setting up the Apache virtual website space in my work.

The Apache of the new version of SuSE has been changed to modular.

So as long as you modify a few files, when you set up an account, the site will correspond to the location.

There is no need to modify the location of the http.conf to build the corresponding / home one by one, and restart the Apache after construction.

1. Modify / etc/sysconfig/apache2

] # vi / etc/sysconfig/apache2

Looking for APACHE_MODULES

Add vhost_alias to the noodles.

Archive recompile apach3 configuration file to load apache2 into vhost module

] # SuSEconfig-- module apache2

two。 Create a new file in / etc/apache2/vhosts.d/ called vhost.conf with the following content

] # 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 place is set differently according to personal preference.

The preset should be / home/%0/public_html

There is no "vhost" in the back of / home, so build an extra layer of directory for convenient management.

So home looks a lot cleaner.

3. Modify default-server.conf

Vi default-server.conf

Looking for ScriptAlias XXXXXX

Comment out this paragraph

# ScriptAlias / cgi-bin/ "/ srv/www/cgi-bin/"

# "/ srv/www/cgi-bin" should 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

#

There are no more catalogs.

The apache2 restart here is OK. Skip the actions of the following 4 directly.

4. If you build one more floor, you will continue to modify the mod_userdir.conf.

] # vi mod_userdir.conf

Find

Change to

File and leave

5. Restart apache2

] # rcapache2 restart

We will build a website in the future.

As long as you create a new USER

If the home directory is directly built into domain, it will be OK.

For example

ABC USER his home directory is built / home/vhost/www.xyz.com

Apache will go to / home/vhost/www.xyz.com/public_html/ automatically.

After reading the above, do you have any further understanding of how to set up the Apache virtual website under the SuSE Linux operating system? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report