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 add virtual hosts for LiteSpeed + support htaccess

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

Share

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

This article mainly shows you "LiteSpeed how to add virtual hosts + support htaccess", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "LiteSpeed how to add virtual hosts + support htaccess" this article.

In order to make this article simple and readable, the general steps are listed as follows:

Add virtual host (Virtual Hosts) + set directory, etc. Listeners binding domain name setting .htaccess pseudo-static support

Before you begin, establish the virtual host directory and set permissions.

The following command assumes that the above users and user groups use the default, and nobody users and nogroup user groups, otherwise please modify accordingly! In addition, in order to facilitate data transfer between LNMP, this article uses the same directory framework as LNMP one-click installation package (view tutorials). Please change vmvps.com to your own domain name ~)

The code is as follows:

Mkdir / home/wwwroot

Mkdir / home/wwwroot/vmvps.com

Mkdir / home/wwwroot/vmvps.com/conf

Chown-R nobody:nogroup / home/wwwroot/vmvps.com

Chmod-R 775 / home/wwwroot/vmvps.com/conf

Please log in to Litespeed (the usual login address is http://ip:7080).

1. Add virtual host (Virtual Hosts) + set directory, etc.

Configuration- > Virtual Hosts

Click Add to add a virtual host

Fill in the following information

Virtual Host Name: whatever. I used the domain name vmvps.comVirtual Host Root:/home/wwwroot/vmvps.comConfig File:$VH_ROOT/conf/vmvps.xml

Click Save

An error was returned because Config File does not have this file, so you need to click CLICK TO CREATE to create it.

Find the virtual host just now and click View/Edit

Switch to the General tab and click Edit in the General tab

Set Document Root to $VH_ROOT and click Save

$VH_ROOT is the virtual host directory, corresponding to the / home/wwwroot/vmvps.com directory we just set ~

Set Index Files, which mainly tells Litespeed who will do the home page when the user visits it.

Please add it according to your needs and separate it in order with ",", such as index.php,index.html,index.htm. Here I only set index.php, and you can do what you need.

two。 Set Listeners bound domain name

The main purpose of this step is to let Litespeed distinguish which website users want to visit.

Configuration- > Listeners Select Default and click View/Edit

The next step is to bind the virtual machine just now ~

Select the virtual machine we just had and enter the domain name to bind!

3. Set .htaccess pseudo-static support

Finally, htaccess is set. What Weimo likes most is that he is compatible with the pseudo-static rules of Apache. I prefer to set it on the server side, so the virtual machines under litespeed support .htaccess by default. Of course, you can also choose to set each one under Virtual Hosts, depending on what you like.

Configuration- > Server- > General- > HT Access- > Edit

Check everything you can check ~ enter .htaccess

Finally, restart Litespeed~

Actions- > Graceful restart above are all the contents of the article "how to add virtual hosts to LiteSpeed + support htaccess". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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