Apache, MySQL, phpMyAdmin configuration under Mac OS X 10.9

Source: Internet
Author: User
Tags phpmyadmin

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Command:mysql_secure_installation +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Note:running all PARTS of this SCRIPT are RECOMMENDED for all MySQL
SERVERS in PRODUCTION use! Please READ each STEP carefully!

In order to log into MySQL to secure it, we'll need the current
Password for the root user. If you ' ve just installed MySQL, and
You haven ' t set the root password yet, the password would be blank,
So, should just press ENTER here.

Enter current password to root (enter for none):
OK, successfully used password, moving on ...

Setting The root password ensures that nobody can log into the MySQL
Root user without the proper authorisation.

You already has a root password set so that you can safely answer ' n '.

Change the root password? [y/n] n
... skipping.

By default, a MySQL installation have an anonymous user, allowing anyone
To log into MySQL without has to has a user account created for
them. This was intended only for testing, and the installation
Go a bit smoother. You should remove them before moving into a
Production environment.

Remove anonymous users? [y/n] Y
... success!

Normally, Root should only is allowed to connect from ' localhost '. This
Ensures that someone cannot guess at the root of password from the network.

Disallow Root login remotely? [y/n] Y
... success!

By default, MySQL comes with a database named ' test ' that anyone can
Access. This was also intended only for testing, and should be removed
Before moving into a production environment.

Remove test database and access to it? [y/n] Y
-Dropping test database ...
... success!
-Removing privileges on test database ...
... success!

Reloading the privilege tables would ensure that all changes made so far
would take effect immediately.

Reload privilege tables now? [y/n] Y
... success!


All done! If you've completed all of the above steps, your MySQL
Installation should now is secure.

Thanks for using mysql!


Cleaning up ...

NOTES:

********************************************************************************

Apache

OS X comes with Apache already installed, so it's as simple as starting up the server. ? Previously, could start this using the System Preferences > Sharing panel, but it had been removed from there in 10 .9. To start the server, first start up Terminal app via Utilities > Terminal, and then enter the command below. You can read the full documentation on the APACHECTL command.

Start Apache:

1
$ sudo apachectl start
Stop Apache:

1
$ sudo apachectl stop
Restart Apache:

1
$
Another useful command is to verify your httpd.conf configuration via the-t test switch.

1
$ sudo apachectl-t

1 to check verison (Apache 2.2.* UNIX comes with OS X 10.9)
Apachectl-v

Then, open the link http://localhost we can see a default test page says "It works!".

********
IMPORTANT
********
The default system path where the localhost points to are (on OS X 10.9):
/library/webserver/documents
Then we can put our newly created site root directory in this place.

2. The Apache server installation is:
/etc/apache2/sudo apachectl Restart
You can find all the configuration files on the server there.
Configuration file:httpd.conf


3. Add PHP support to Apache server so, it can handle with the files ended up
With. php or. Phps
and configure the default responding pages for directory requests to the server.

(By default, Apache isn't configured to serve PHP files, so we need to change it!)


Follow the steps:
Php
Begin ************************************

PHP is already installed for your in OS X 10.9 Mavericks. ? It ' s as simple as modifying the httpd.conf file again.

On line 118, uncomment the LoadModule for PHP:
LoadModule Php5_module libexec/apache2/libphp5.so
On line 231, add index.php as a default document if a directory is requested:
DirectoryIndex index.html index.php
Lastly, we need to tell Apache to use the PHP handler when requesting files and end in. php or. Phps. ? Append the following code to the end of your httpd.conf file.

#PHP Settings
<ifmodule php5_module>
AddType application/x-httpd-php. php
AddType Application/x-httpd-php-source. Phps
</IfModule>
Don ' t forget to restart the Apache server after making any changes to your httpd.conf file.
End ************************************

4. If we want to change the root directory of our web contents files (ie. Document Root in Apache server configuration)

Begin ************************************

Make the following changes to the httdp.conf file.

On line, change the DocumentRoot:
DocumentRoot "/www"
On line 197, change the Directory location:
<directory "/www" >
On line 217 (within the Directory where we just updated), change the allowoverride to ' all ' so this we can use. htacces s to modify any settings for our local sites:
AllowOverride All
On line 429, uncomment the Include of the httpd-vhosts.conf file:
Include/private/etc/apache2/extra/httpd-vhosts.conf

End ************************************


Phpadmin
http://coolestguidesontheplanet.com/installing-phpmyadmin-on-mac-osx-10-7-lion/

+************* IMPORTANT **************
When
# Virtual Hosts
#Include/private/etc/apache2/extra/httpd-vhosts.conf

In the httpd.conf are uncommented, then localhost'll be redirected to/.
Example:

Http://localhost/phpMyAdmin is compiled as virtualhost/phpmyadmin. If your virtual
Host is not configured correctly and then it would lead to a not Found error.


________________________________________________________________________________


Mysql

1. Start the MySQL server:
$ mysql.server Start

A few reference links:

Main reference http://brianflove.com/2013/10/23/os-x-mavericks-and-apache/

http://blog.csdn.net/ww122081351/article/details/18809197

Error Message "Forbidden you do not have permission to access/on this server"

http://www.cyberciti.biz/faq/apache-403-forbidden-error-and-solution/

Http://superuser.com/questions/270746/are-there-any-differences-between-etc-and-private-etc

Advanced Features: http://docs.phpmyadmin.net/en/latest/setup.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.