Installing Apache, PHP, and MySQL on Fedora Core
2008-12-05 00:00
519 查看
This will install the basic components for a dynmaic, database-driven web site. We use
yum to handle dependencies and gather all of the required packages.
1. Install Apache (httpd), PHP, MySQL (server and client), and the component that allows
php to talk to mysql.
2. Configure the new services to start automatically
3. IMPORTANT! Set up the mysql database root password. Without a
password, ANY user on the box can login to mysql as database root. The
mysql root account is a separate password from the machine root
account.
4. Make additional security-related changes to mysql.
5. Following the above steps, the document root for Apache is /var/www/html/
Create a test PHP script (such as phpinfo.php) and place it in the document root. A useful
test script sample:
6. Create a database and database user for your data. You will use this database and user name
in your database connection string. The GRANT statement actually creates a new MySQL user account.
yum to handle dependencies and gather all of the required packages.
1. Install Apache (httpd), PHP, MySQL (server and client), and the component that allows
php to talk to mysql.
yum -y install httpd php mysql mysql-server php-mysql
2. Configure the new services to start automatically
/sbin/chkconfig httpd on /sbin/chkconfig --add mysqld [this is not required with FC4 and above] /sbin/chkconfig mysqld on /sbin/service httpd start /sbin/service mysqld start
3. IMPORTANT! Set up the mysql database root password. Without a
password, ANY user on the box can login to mysql as database root. The
mysql root account is a separate password from the machine root
account.
mysqladmin -u root password 'new-password' [quotes are required]
4. Make additional security-related changes to mysql.
mysql -u root -p mysql> DROP DATABASE test; [removes the test database] mysql> DELETE FROM mysql.user WHERE user = ''; [Removes anonymous access] mysql> FLUSH PRIVILEGES;
5. Following the above steps, the document root for Apache is /var/www/html/
Create a test PHP script (such as phpinfo.php) and place it in the document root. A useful
test script sample:
<?php phpinfo(); ?>
6. Create a database and database user for your data. You will use this database and user name
in your database connection string. The GRANT statement actually creates a new MySQL user account.
mysql> CREATE DATABASE web_db; mysql> GRANT ALL PRIVILEGES ON web_db.* TO 'web_user'@'localhost' IDENTIFIED BY 'thepassword';
相关文章推荐
- Installing Apache, PHP, and MySQL on Mac OS X
- Simple Tutorial for installing Apache, PHP, MySQL and phpMyAdmin on Ubuntu
- Installing JBoss jBPM 3.2.2 on Apache Tomcat 5.5 and MySQL
- How to install and configure Apache, PHP, MySql and phpMyadmin on ubuntu
- Get Apache, MySQL, PHP and phpMyAdmin working on OSX 10.10 Yosemite
- Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support (LEMP) On Ubuntu 12.04 LTS [repost]
- Install Apache, PHP And MySQL On CentOS 7 (LAMP)
- Setup Apache, PHP, MySQL and WordPress on Mac OS X 10.8.3
- Install Apache, PHP And MySQL On CentOS 7 (LAMP)
- Install Apache 2.2.15, MySQL 5.5.34 & PHP 5.5.4 on RHEL/CentOS 6.4/5.9 & Fedora 19-12
- how to install apache, PHP and MySQL on Linux
- Install ProcessMaker - Installing Apache, MySQL and PHP
- Install Apache, PHP And MySQL On CentOS 7 (LAMP)
- how to install apache, PHP and MySQL on Linux 2
- How to Install Apache, MySQL, PHP, and phpMyAdmin on FreeBSD
- Install 64bit versions of Apache, PHP and MySQL on Windows 64bit
- Install and config Apache, PHP, MySql on windows XP
- how to install apache, PHP and MySQL on Linux 3
- How to Install LAMP (Apache 2.4, MySQL 5.6, and PHP 5.4) on CentOS/RHEL 7
- Install Apache, Php, Mysql, Symfony on Fedora