I would like to ask you a question because a strange phenomenon occurred while building a website development environment the other day.
What is a strange phenomenon?
That's right.
It was difficult to know how to tell you about the situation, so I would like to write down the work I did in chronological order as much as possible.Please forgive me for the long delay.
I created a virtual machine in the following environment
■The host machines are as follows
■ VirtualBox 4.3.30 Virtual Machine Configuration is as follows
■ As WordPress is required for the development environment, we installed the following additional information on the virtual machine
■Also, we set the following settings
General
Add Working User
Password setting for working user
Add working users to the wheel group (for sudo to run)
sshd
Prohibit root login
Disable password authentication
RSA enabled
Public lock authentication enabled
rhost authentication disabled
Generate and arrange public and private keys for use
mysql
initial configuration with mysql_secure_installation
Creating a database for wordpress
Creating a User in the Database for Wordpress
User Permission Settings
Autoboot Settings
PHP
add path to mysql.ini
mysql.so
Enable error indication in php.ini
httpd
Add index.php
to the index file type
Autoboot Settings
Change /var/www/http/
owner to working user
iptables
Open 80 ports
General
Add Working User
Password setting for working user
Add working users to the wheel group (allow sudo to run)
sshd
Prohibit root login
Disable password authentication
RSA enabled
Public lock authentication enabled
rhost authentication disabled
Generate and arrange public and private keys for use
mysql
initial configuration with mysql_secure_installation
Creating a database for wordpress
Creating a User in the Database for Wordpress
User Permission Settings
Autoboot Settings
PHP
add path to mysql.ini
mysql.so
Enable error indication in php.ini
httpd
Add index.php
to the index file type
Autoboot Settings
/var/www/http/
owner changed to working user
iptables
Open 80 ports
At this point, ssh, httpd, mysql, etc. are successful, and we are also checking the execution of php files using httpd.
Now that the minimum configuration of the virtual machine is complete, we have started installing wordpress.
Download the wordpress file from the working user directory (/home/working user/)
Unzip as it is
$tar zxvf wordpress-4.2.4-ja.tar.gz
Copy the wordpress file to the unzipped document route/var/www/html/
$cp-R to /wordpress/*/var/www/html/
After copying, cd
to /var/www/html/
and edit wp-sample-config.php
.Save as wp-config.php
Download the wordpress file from the working user directory (/home/working user/)
$wgethttp://ja.wordpress.org/wordpress-4.2.4-ja.tar.gz
Unzip as it is
$tar zxvf wordpress-4.2.4-ja.tar.gz
Copy wordpress files to the extracted document route/var/www/html/
$cp-R to /wordpress/*/var/www/html/
After copying, cd
to /var/www/html/
and edit wp-sample-config.php
.Save as wp-config.php
Wordpress then performs the final configuration by accessing the install.php
from a browser in the wp-admin directory (/var/wwww/html/wp-admin/
).
However, the access to **install.php
is now 403**
At this point, Permission, Owner: The ownership group was as follows:
/var/www/html/
/var/www/html/wp-admin/
/var/www/html/wp-admin/install.php
In this state, at least recognized that it would not be played (to be 403), but since it was played in reality, we did the following:
I have set the permission of the above directory files to 777.(Also, if you change the permission just in case, we are restarting the operating system.The same goes for the following tasks.)
I set the permission of the above directory file to 777.(Also, if you change the permission just in case, we are restarting the operating system.The same goes for the following tasks.)
The 777 is also 403, so we first checked if PHP can run in /var/wwww/html/
as some configuration is wrong.
Try running install.php
on the command line
/var/www/http/
to display phpinfo()
and access it from your browser
/var/www/html/wp-admin/
to display phpinfo()
and access it from your browser
Try running install.php
on the command line
Create a file to display phpinfo()
in /var/www/http/
and access it from your browser
Create a file to display phpinfo()
in /var/www/html/wp-admin/
and access it from your browser
I thought there was something wrong with the wp-admin directory, so I checked the following.
/var/www/html/wp-admin/
is renamed and saved (.wp-admin) to create a new wp-admin directory.Create a file to display phpinfo()
and access it from your browser
Access install.php
from your browser by cp
cpstoring the contents of the .wp-admin directory in the newly created wp-admin directory.
Rename /var/www/html/wp-admin/
and save (.wp-admin) to create a new wp-admin directory. Create a file to display phpinfo()
and access it from your browser
Access install.php
from your browser by cp
storing the contents of the .wp-admin directory in the newly created wp-admin directory
At this point, I thought that there was something wrong with cp
from the working user directory to /var/www/html/
, so I did the following:
/var/www/html/
contains rm
.Relocate the newly downloaded and extracted file and access install.php
from your browser
/var/www/html/
contains rm
.Relocate the newly downloaded and extracted file and access install.php
from your browser
I'm running out of hands, but I thought it might be because of the ownership group, so I did the following:
/var/www/html/
and subsequent directory file owners:
/var/www/html/
and subsequent directory file owners:
/var/www/html/
and subsequent directory file owners:
/var/www/html/
and subsequent directory file owners:
It doesn't seem to be the owner's problem, so I returned the owner: ownership group to the working user: working user
At this point, I ran out of ideas and desperately rm
inside /var/www/html
and /var/www/html/
I re-positioned the file with the permission of 777.You can now successfully access install.php
.
The permission of /var/www/html
is 755, so what has changed compared to the resolution is that
/var/www/html/
has or does not have other write permissionsI think that's what it means.
My understanding is that PHP execution can be done if you have permission to do it.
If rwxr-xr-x
, wouldn't it be possible to use permission to access the browser?
What has changed is not execution permission, but write permission, and I don't understand the solution at all.
We were able to run the file that displays phpinfo()
that we created for further verification.
If /var/www/html/
has some kind of bug, I think it is impossible to run a file that displays phpinfo()
in the first place.
Incidentally, after confirming that /var/www/html/
was accessible to install.php
, I returned /var/www/html/
to 755, but install.php
was accessible.
After solving the problem, I tried to reproduce the problem again, but I couldn't.
Also, I created a new virtual machine and tried again from OS installation, but the problem was not reproduced.
I haven't had any problems since then, but I'm still wondering why this happened.
Perhaps there is something wrong with my work procedures, but I would appreciate it if you could give me information about the behavior of permissions and owner privileges as described above.
linux centos wordpress
The response code 403 Forbiden has been played because it has not been authenticated by the user in the application or has not been authenticated by the web server, so it is estimated that
I think that's about it.
I'm sorry if it's wrong.
© 2024 OneMinuteCode. All rights reserved.