Thursday 28 May 2015

Setting Apache Centos to Access Remotely



How to restart Apache (HTTP) in Linux (Centos)

For those using our managed servers with root access, here are the commands to do it from the command line:

to restart:
/sbin/service httpd restart
to start:
/sbin/service httpd start
to stop:
/sbin/service httpd stop

How to View Apache Status

(Tell if it is running)
/etc/init.d/httpd status
(Example of Apache being stopped)

Setting to change or add :

Add Aliases
vi /etc/httpd/conf.d/phpmyadmin.conf
Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin 
 
Change from cookie to http
vi /usr/share/phpmyadmin/config.inc.php [...] /* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'http'; [...] 

Restart
/etc/init.d/httpd restart 


in /etc/httpd/conf.d/phpMyAdmin.conf
 
Currently, this setup is configured to deny access to any connection not being made from the server itself. Since we are working on our server remotely, we need to modify some lines to specify the IP address of your home connection.
Change any lines that read Require ip 127.0.0.1 or Allow from 127.0.0.1 to refer to your home connection's IP address. If you need help finding the IP address of your home connection, check out the next section. There should be four locations in the file that must be changed:
. . .
Require ip your_workstation_IP_address
. . .
Allow from your_workstation_IP_address
. . .
Require ip your_workstation_IP_address
. . .
Allow from your_workstation_IP_address
. . .
When you are finished, restart the Apache web server

If you can not authenticate via the web interface (localhost/phpmyadmin/) then try change authentication type to cookie.
$cfg['Servers'][$i]['auth_type'] = 'cookie';


Rujukan :

https://aztech.net.au/node/77

http://mixeduperic.com/centos/how-to-start-stop-restart-and-check-the-status-apache-and-mysql-on-centos.html

https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-with-apache-on-a-centos-7-server

http://stackoverflow.com/questions/7499849/phpmyadmin-centos-6-0-forbidden

http://stackoverflow.com/questions/22333581/xampp-mysql-password-setting


 

No comments:

Post a Comment