LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache: You don't have permission to access /wordpress/ on this server. (https://www.linuxquestions.org/questions/linux-server-73/apache-you-dont-have-permission-to-access-wordpress-on-this-server-748934/)

IKT 08-20-2009 01:30 AM

Apache: You don't have permission to access /wordpress/ on this server.
 
Hi.

When i write in the IP of the apache server in webbrowser the default apache page comes up. But when i write xx.xx.xx.xx/wordpress i get You don't have permission to access /wordpress/ on this server.

Heres is the permission on the folder:
Code:

drwxr-xr-x 5 root apache 4096 2009-08-19 16:04 wordpress
Should i defind the wordpress in the httpd.conf to? I have tried it, but dont work.

Can someone help me?

bathory 08-20-2009 01:48 AM

What happens if you use: http://x.x.x.x/wordpress/index.php
Check the apache error_log for details on this error.

Regards

IKT 08-20-2009 03:02 AM

Quote:

Originally Posted by bathory (Post 3650452)
What happens if you use: http://x.x.x.x/wordpress/index.php
Check the apache error_log for details on this error.

Regards

You don't have permission to access /wordpress/index.php on this server.

error_log: [Thu Aug 20 11:04:39 2009] [error] [client 32.53.34.166] (13)Permission denied: access to /wordpress/index.php denied

bathory 08-20-2009 03:20 AM

What is the output of:
Code:

ls -ld /path/to/wordpress

IKT 08-20-2009 03:27 AM

Quote:

Originally Posted by bathory (Post 3650526)
What is the output of:
Code:

ls -ld /path/to/wordpress

drwxr-xr-x 5 root apache 4096 2009-08-19 16:04 /var/www/html/wordpress/

bathory 08-20-2009 03:33 AM

What distro are you using? Could be a SELinux permissions problem.

IKT 08-20-2009 03:58 AM

Quote:

Originally Posted by bathory (Post 3650535)
What distro are you using? Could be a SELinux permissions problem.

It is Fedora 11.

bathory 08-20-2009 04:42 AM

So it's more likely SELinux.
Running
Code:

ls -Z /var/www/html/wordpress
should tell you if that's the case.
I'm not very familiar with SELinux but after reading a little, I think that yu should run
Code:

chcon -R -h -t httpd_sys_content_t /var/www/html/wordpress
to change the security context.

IKT 08-20-2009 04:51 AM

Quote:

Originally Posted by bathory (Post 3650605)
So it's more likely SELinux.
Running
Code:

ls -Z /var/www/html/wordpress
should tell you if that's the case.
I'm not very familiar with SELinux but after reading a little, I think that yu should run
Code:

chcon -R -h -t httpd_sys_content_t /var/www/html/wordpress
to change the security context.

It helped a litle. Now i get Internal servererror when I visit the page:

http://10.22.36.11/wordpress/index.php
http://10.22.36.11/wordpress/

bathory 08-20-2009 04:58 AM

Take a look again at error_log to see if you find more on this error

IKT 08-20-2009 05:18 AM

Quote:

Originally Posted by bathory (Post 3650617)
Take a look again at error_log to see if you find more on this error

[Thu Aug 20 12:53:06 2009] [error] [client 32.53.34.166] Directory index forbidden by Options directive: /var/www/html/

hua 08-20-2009 05:19 AM

There is a virtualhost config like this in your appache configuration files:
Code:

<VirtualHost 111.22.33.44>
    ServerName www.xxxx.com
    DocumentRoot /var/www/html
</VirtualHost>

Here you define the name of your site and the directory which contains the code for your web. Add this to the config file. (the section Directory)
Code:

<VirtualHost 111.22.33.44>
    ServerName www.xxxx.com
    DocumentRoot /var/www/html
    <Directory "/var/www/html/wordpress">
        AllowOverride None
        Options All
        Order allow,deny
        Allow from all
        DirectoryIndex index.php index.html index.htm
    </Directory>
</VirtualHost>

The Options should be not None but All.
Although I have no idea for what do you need this - it worked for me.
NOTE!!
I did not examine what such configuration can cause on your web. Do this on your own responsibility.

bathory 08-20-2009 05:35 AM

Quote:

[Thu Aug 20 12:53:06 2009] [error] [client 32.53.34.166] Directory index forbidden by Options directive: /var/www/html/
This is not the wordpress directory, but your DocumentRoot. Does wordpress work now?
As for the error, you have to add "+Indexes" in the Options directive for the Directory in question and maybe add index.php in the DirectoryIndex line as hua mentioned.

IKT 08-20-2009 06:52 AM

Quote:

Originally Posted by bathory (Post 3650652)
This is not the wordpress directory, but your DocumentRoot. Does wordpress work now?
As for the error, you have to add "+Indexes" in the Options directive for the Directory in question and maybe add index.php in the DirectoryIndex line as hua mentioned.

When i typed in http://10.22.36.11/wordpress/wp-install/install.php it came up. But now i have problems with mysql. So i figure out that I install fedora again. I think that is the best thing to do now.

bathory 08-20-2009 06:57 AM

IMHO you don't have to reinstall the OS. If it's a generic mysql problem post it here, or create another thread for it.
If it's specific to WP, I think that you can read the wordpress documentation on how to add a table in mysql to use it with WP.

Regards


All times are GMT -5. The time now is 06:39 AM.