macos - How to modify the default access site folder path of Apache for a specified user on Mac
给我你的怀抱
给我你的怀抱 2017-05-16 17:01:20
0
5
802

As the title states, I want to modify the default access folder path of Apache under my user (Donny). In other words, modify the path accessed by http://localhost/~Donny/. The current default access path is ~/Website. Can it be changed to another location? How to write the user's configuration file?

给我你的怀抱
给我你的怀抱

reply all(5)
大家讲道理

No one answered. .

漂亮男人

find . -name http.conf
vi http.conf Modify the <DocumentRoot> item and specify the path you want

滿天的星座

I don’t know if it can solve the problem, I just provide an idea.

Change host.

phpcn_u1582

I am currently using the mac apache environment. The configuration is similar to that of linux. The main problem is that the permissions issue needs to be dealt with. If you are lazy, you can do some work on the user while apache is running

phpcn_u1582

Complete your needs by modifying the http-vhosts.conf file.
Here is the configuration snippet from that profile on my Mac

<VirtualHost *:80>
         DocumentRoot "/path" #这里指定你的网站根目录
         ServerName example.com
         ErrorLog "/private/var/log/apache2/sites-error_log"
         CustomLog "/private/var/log/apache2/sites-access_log" common
         <Directory />
                 Options Indexes FollowSymLinks MultiViews
                 AllowOverride All
                 #Order deny,allow
                 #Allow from all
                 Require all granted
         </Directory>
</VirtualHost>

By default, the directory of my apache program is in /etc/apache2, and the configuration file is in the extra directory under this directory. There are many configuration files in it. These configuration files are generally under the /etc/apache2 directory. Referenced by the main configuration file httpd.conf.

You can refer to my configuration snippet to modify your http-vhosts.conf file. After the modification is completed, you need to restart apache.

In fact, these configurations are the same whether on Mac or Linux. The official apache documentation also provides detailed documentation. As long as you read it patiently, you will find the answer quickly.

Hope this helps.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template