I want to build a LAMP environment on VirtualBox.
We installed the operating system and middleware in the following environments:
Create index.php with the following contents.
<?php
phpinfo();
?>
Now that I have accessed http://192.168.3.5 and checked phpinfo, I can use PHP.
You can also connect to mysql from a virtual terminal.
Problem (1)
After accessing http://localhost,
The page cannot be displayed due to the following error
•Verify that the web address http://localhost is correct.
Problem (2)
After accessing http://192.168.3.5/phpMyAdmin,
The following error prevents phpMyAdmin login screen from appearing.
Forbidden
You don't have permission to access/phpMyAdmin/on this server.
Apache/2.2.15 (CentOS) Server at 192.168.3.5 Port 80
Restarting the iptables service by adding the following line to the /etc/sysconfig/iptables configuration file will not resolve the above error:
-AINPUT-m state --state NEW-m tcp-ptcp --dport80-j ACCEPT
Could you tell me how to solve this problem?
Thank you for your cooperation.
The main settings are as follows:
(1) Change /etc/httpd/conf/httpd.conf
(2) /etc/httpd/conf.d/phpMyAdmin.conf New
with the following contents
(3) Change /var/www/html/phpMyAdmin/config.inc.php
$cfg['browfish_secret'] = 'hogehoge';
$cfg['Servers'][$i]['auth_type']='cookie';
$cfg['Lang'] = 'ja-utf-8';
(4) Change the owner of phpMyAdmin
chown-Root.apache/var/www/html/phpmyadmin/
(5) Configure the database in /var/www/html/define.php
define("DB_SERVER_NAME", "localhost";
define("DB_USER_NAME", "root";
define("DB_USER_PASS", "testpass";
define("DB_NAME", "testdb";
Have you configured the environment after installation?phpMyAdmin.conf or conf.inc.php.
As for the 403 error, the apache configuration file (phpMyAdmin.conf) generated during phpMyAdmin installation only allows access from the installed server, so I think this is the cause.
Edit /etc/httpd/conf.d/phpMyAdmin.conf to allow access from ip addr other than 127.0.0.1.
Other settings should be set according to your installed environment (path and so on).
/etc/httpd/conf.d/phpMyAdmin.conf
is set to deny connections from all clients.
Change to Order Deny, Allow
.
<Directory"/var/www/html/phpMyAdmin">
Order deny, allow
Allow from all
Deny from all
</Directory>
© 2024 OneMinuteCode. All rights reserved.