Apache configures virtual directories, virtual hosts. A series of questions about the default directory

Source: Internet
Author: User
Tags web hosting
Apache configures virtual directories, virtual hosts. A series of problems with the default directory!
Recently self-taught PHP, encountered a few tangled problems, illuminance Niang method also did not solve, helpless to help you Daniel
(1) installed Apache has a default site path, with 127.0.0.1 can directly access, now I configure a virtual directory, but still can not parse the directory of PHP files, delete the default site path is OK, is not configured virtual directory or virtual host must delete the default site path? Will that affect the performance of Apache for PHP support?
(2) Default site path, virtual directory, virtual host what is the difference between these three?

(3) There is also a problem, the configuration of Apache,php,mysql, installed a CMS, the installation process is not prompt error, after the end of the visit to the homepage is a bunch of garbled (exactly the code and some path), but also to see the site's pictures, the following code also and the site content overlap, what is the matter? No function code to open?

------Solution--------------------
Reference: Installation of Wamp and construction of the environment
------Solution--------------------
To your Apache/conf/extra directory http-vhosts.conf Configure the virtual host

DocumentRoot "D:\wamp\www\ename\eNameAdmin"
ServerName admin.ename.com
#ServerAlias Www.dummy-host.hleclerc-PC.ingenidev
Errorlog "Logs/dummy-host.hleclerc-pc.ingenidev-error.log"
Customlog "Logs/dummy-host.hleclerc-pc.ingenidev-access.log" common

such as this.
Enter c:/windows/system32/drivers/etc/hosts
127.0.0.1 admin.ename.com
The virtual host is configured.
------Solution--------------------
What is the key to your web hosting is the domain name, or *? If it is *, then the overall priority should be given.
------Solution--------------------
If you set up only one web directory,
Listen 80
DocumentRoot Set "C:\myweb" (your Web specific path, if it is Linux, then similar to/home/myweb) can

If you are setting up another virtual directory, you can refer to the following:
Listen 80
Listen 8081

ServerAdmin [email protected]
DocumentRoot "e:/myweb/"
ServerName www.zalvsa.com
Errorlog Logs/dummy-host.example.com-error_log
Customlog Logs/dummy-host.example.com-access_log Common


Restart Apache
------Solution--------------------
(3) There is one more question

I guess the path error caused the CSS and other files to work incorrectly
------Solution--------------------
Add a default
Namevirtualhost *:80

DocumentRoot "E:/www"
ServerName localhost
Serveralias localhost


Options Indexes followsymlinks MultiViews
AllowOverride All
Order Allow,deny
Allow from all
  • 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.