Apache, MySQL, phpMyAdmin在Mac OS X 10.9 下的配置
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Apache, MySQL, phpMyAdmin在Mac OS X 10.9 下的配置,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含6320字,纯文字阅读大概需要10分钟。
内容图文
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Command: mysql_secure_installation +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS 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 will be blank,
so you should just press enter here.
Enter current password for 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 have a root password set, so you can safely answer ‘n‘.
Change the root password? [Y/n] n
... skipping.
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make 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 be allowed to connect from ‘localhost‘. This
ensures that someone cannot guess at the root 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 is 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 will ensure that all changes made so far
will 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 be 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, you could start this using the System Preferences > Sharing panel, but it has 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 is (on OS X 10.9) :
/Library/WebServer/Documents
Then we can put our newly created site root directory in that place.
2. the apache server installation location is :
/etc/apache2/sudo apachectl restart
You can find all the configuration files about the server there.
configuration file: httpd.conf
3. Add php support to apache server so that 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 is not configured to serve php files, so we need to change it!)
Follow the steps:
PHP
************************************* begin ************************************
PHP is already installed for you 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 that 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 170, change the DocumentRoot:
DocumentRoot “/www”
On line 197, change the Directory location:
<Directory “/www”>
On line 217 (within the Directory location we just updated), change the AllowOverride to “All” so that we can use .htaccess 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 is uncommented, then localhost will be redirected to /.
Example:
http://localhost/phpMyAdmin is compiled as virtualHost/phpMyAdmin. if your virtual
host is not configured correctly, then it will lead to a NOT Found error.
________________________________________________________________________________
MySQL
1. start the mysql server:
$ mysql.server start
几个参考的链接:
主要参考 http://brianflove.com/2013/10/23/os-x-mavericks-and-apache/
http://blog.csdn.net/ww122081351/article/details/18809197
Error message “Forbidden You don‘t 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
高级功能: http://docs.phpmyadmin.net/en/latest/setup.html
原文:http://www.cnblogs.com/qliang/p/3928479.html
内容总结
以上是互联网集市为您收集整理的Apache, MySQL, phpMyAdmin在Mac OS X 10.9 下的配置全部内容,希望文章能够帮你解决Apache, MySQL, phpMyAdmin在Mac OS X 10.9 下的配置所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。