Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

403 error on configuring new wordpress install

         

elvang

6:05 am on Mar 5, 2022 (gmt 0)

Top Contributors Of The Month



Hello,
I am setting up wordpress to linux with ubuntu. But in 'configure wordpress' part it gave an error like 'Forbidden
You don't have permission to access this resource.

Apache/2.4.29 (Ubuntu) Server at xxx.yyyy.com Port 443'

do you have any idea what should i do?

Thank you.


[edited by: not2easy at 2:16 pm (utc) on Mar 5, 2022]
[edit reason] Please see TOS [webmasterworld.com] [/edit]

not2easy

2:51 pm on Mar 5, 2022 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



That 403 error is usually due to improper folder and file permissions but may be due to using installation steps out of order. When you do not use an installer to set up the WP installation and configuration you need to prepare the domain to accept the installation before you get started. You do not mention creating a database and preparing a wp-config.php file before starting.

If you have done that then check that most of your file permissions are set to 644 and folders should be set to 755. Note that if the WP user is not the file and folder owner then permissions may need to be set differently. Specific files should have higher security permissions. That is why it is better to use a specialized installer program (offered on most hosts) rather than doing a manual install unless you are familiar with such settings.

WordPress offers step by step 'How to Install WordPress" instructions so you can skip to the parts you need help with: [wordpress.org...]

phranque

9:51 pm on Mar 5, 2022 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



But in 'configure wordpress' part it gave an error like 'Forbidden
You don't have permission to access this resource.

while this wording of this error message sounds like a web response (403 status code), your statement is unclear and makes it seem like you got that message from the operating system while configuring the wordpress installation.
could you please clarify where you saw this message?

elvang

7:03 am on Mar 6, 2022 (gmt 0)

Top Contributors Of The Month



Thank you not2easy and phranque. I decided to use specialized installer program that hosting company provided. It is better for me as not2easy said. Because i am not that much familiar with files, permissions, codes, etc. Before i attempt to install wordpress i was able to open my domain in browser. But now i can not open it. And i used three different guides while i was trying to download it. Because each of them didnt work for me for that reason i had to try three of them. And i dont know how to undo the commands and how to turn back to the beginning. I just know to remove wordpress directory and wordpress database in mysql.

But beside this, there is also a database in phpmy admin. Should i delete it? I listed which the codes that i used during installation. And i would be gratefull if you can tell me how can i turn to the beginning. Thank you.

First Guide

wget http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
mysql -u root -p
CREATE DATABASE wordpress; Query OK, 1 row affected (0.00 sec)
CREATE USER wordpressuser@localhost; Query OK, 0 rows affected (0.00 sec)
SET PASSWORD FOR wordpressuser@localhost= PASSWORD("password"); Query OK, 0 rows affected (0.00 sec)
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password'; Query OK, 0 rows affected (0.00 sec)
FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec)
cp ~/wordpress/wp-config-sample.php ~/wordpress/wp-config.php
sudo nano ~/wordpress/wp-config.php
// ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', 'wordpress'); /** MySQL database username */ define('DB_USER', 'wordpressuser'); /** MySQL database password */ define('DB_PASSWORD', 'password');
sudo rsync -avP ~/wordpress/ /var/www/
cd /var/www/
sudo chown username:www-data /var/www -R sudo chmod g+w /var/www -R
sudo apt-get install php5-gd


As This Guide Didnt Work for me I used this second Guide Deleting Wordpress Directory

cd /var/www/html
sudo wget https://wordpress.org/latest.tar.gz
sudo tar xvfz latest.tar.gz
sudo chown www-data.www-data wordpress/


Those Commands Also Didnt Work For Me So I Added The Other Ones Below

First i created a wordpress database in msql after deleting the previous one.
sudo mkdir -p /var/www/html/example.com/src/
cd /var/www/html/example.com/src/
chmod 755 /var/www/html
chmod 750 /var/www
sudo chown -R www-data:www-data /var/www/html/example.com/
sudo wget http://wordpress.org/latest.tar.gz
sudo -u www-data tar -xvf latest.tar.gz
sudo mv latest.tar.gz wordpress-`date "+%Y-%m-%d"`.tar.gz
sudo mkdir /var/www/html/example.com/public_html/
sudo mv wordpress/* ../public_html/
sudo chown -R www-data:www-data /var/www/html/example.com/public_html


Now my question is: how can i turn back to the beginning where i was able to open my domain on browser. Because after setting up my ssl i was able to browse it :(

Thank you.

elvang

11:30 am on Mar 6, 2022 (gmt 0)

Top Contributors Of The Month



I found out that i can not delete the directory. As my hosting is vps i have to create everything from the beginning. Instead of this i should try to fix it. What are the files or other things to check? If i check them maybe i can find out what the problem is.

not2easy

12:21 pm on Mar 6, 2022 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



It sounds like there might have been an error on the settings setup. How are you accessing your VPS files? Hosts offer different ways to deal with file management and it would help to know what route you are using for adding and removing files. Where do you deal with your .sql database(s)? If you can access your wp-config.php file you can see the database name and password for your WP install.

elvang

12:52 pm on Mar 6, 2022 (gmt 0)

Top Contributors Of The Month



İ am using ubuntu

elvang

12:58 pm on Mar 6, 2022 (gmt 0)

Top Contributors Of The Month



I am using ubuntu in terminal. I can see my database name and password. But i dont know which files should i give permission. For example in last commands hosting company's guide made me rename latest.tar.gz as wordpress. And https://bpa.st/T52A here this file has no permisson. How can give permission to it?



[edited by: not2easy at 1:44 pm (utc) on Mar 6, 2022]
[edit reason] unlinked pasted file for privacy/security [/edit]

not2easy

1:29 pm on Mar 6, 2022 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Permissions for files use CHMOD to assign permissions. I don't use Terminal for this (I haven't used Terminal for very much since around 1985) so I cannot offer much help. I use SFTP for most file management just for the user friendly interface.

I used our site search and turned up some old discussions about chmod on linux and ubuntu and that search turned up some explanations at the manpagez site: [manpagez.com...]
I hope that helps.

Kendo

5:58 pm on Mar 6, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



As my hosting is vps i have to create everything from the beginning.


This sounds like a limitation of the hosting plan and control panel being used. If using a VPS I recommend starting with a barebones Linux OS setup, and then using command prompt to install Webmin as your control panel. Then you can do anything that want without limitation. Also, Webmin's file manager is ideal for uploading, downloading and even editing pages and scripts live.

Of course it will involve a learning curve, but worth it in the long run.