Alias /hc/ "/home/bitnami/hanchuan/htdoc" Alias /hc "/home/bitnami/hanchuan/htdoc" <Directory "/home/bitnami/hanchuan/htdoc"> AllowOverride None Order allow,deny Allow from all </Directory>
Visit http://alangs.info/hc or http://alangs.info/hc/index.php
They all reported the error of not having permission to access.
In fact, /home/bitnami/hanchuan/htdoc/index.php exists.
Where is the error?
The problem is solved.
Put: Order allow,deny
Change to: Order deny,allow
You can access it.
The strange thing is that other directories can be accessed without writing them like this.
高洛峰2017-05-16 17:07:07
@alang You should also start with the logs. You have already said that you have read the logs, but have you adjusted the LogLevel? The default level may not be enough.
-------------------------------------------------
Order order see:
The Order command controls the default access status and the order in which the Allow and Deny commands take effect. The Ordering value range is one of the following examples:
Deny, Allow The
Deny directive is evaluated before the Allow directive. All access is allowed by default. Any client that does not match the Deny directive or matches the Allow directive is allowed access.
Allow,Deny
Allow directive is evaluated before Deny directive. All access is denied by default. Any client that does not match the Allow directive or matches the Deny directive will be denied access.
… …
I saw this sentence in the manual:
Note: If there is a suffix "/" in the url-path, the server requires a suffix "/" to extend this alias. In other words, "Alias /icons/ /usr/local/apache/icons/" cannot alias "/icons".
Alias /hc/ "/home/bitnami/hanchuan/htdoc"
PHP中文网2017-05-16 17:07:07
chmod 755 /home/bitnami/hanchuan/htdoc Try it, it may be that this directory does not have read and write permissions for other users
我想大声告诉你2017-05-16 17:07:07
ls -l Check the properties and permissions of /home/bitnami/hanchuan/htdoc, and check the group and owner, because there may be problems in the home directory!
我想大声告诉你2017-05-16 17:07:07
Please see the error.log for these problems, it will tell you everything
ringa_lee2017-05-16 17:07:07
Check if it’s a problem with selinux and fix it
setenforce 0
Try again
高洛峰2017-05-16 17:07:07
Problem solved.
Put: Order allow, deny
Change to: Order deny,allow
You can access it.
The strange thing is that other directories can be accessed without writing them in this way.