Build LAMP under Fedora19

Source: Internet
Author: User
Tags exit in
Build LAMP under Fedora19. Install Mysqlyuminstallmysqlmysql-server and set boot start: chkconfig -- restart to check whether mysql: rpm-qa | grep-imysql is installed. Restart: servicemysqldstart: servicemysqldrestart

Build LAMP under Fedora 19

1. Install Mysql
Yum install mysql-server
Set boot start:
Chkconfig -- levels 235 mysqld on
Check whether mysql: rpm-qa | grep-imysql is installed.
Start: service mysqld start
Stop: service mysqld stop
Restart: service mysqld restart

Set the root password for Mysql (set by XXXX ):
Mysqladmin-u root password XXXX

Ii. Install the Apache service
Yum install httpd
Set boot start:
Chkconfig -- levels 235 httpd on
Check whether Apache: rpm-qa | grep-ihttpd is installed.
Start: service httpd start
Stop: service httpd stop
Restart: service httpd restart

Test whether the Apache service is successfully installed and started. Visit the Home Page 127.0.0.1 or local IP address.
If Fedora Test Page is displayed, the installation is successful.
Under Fedora, the default Apache site root directory is located at/var/www/html.
The default configuration file is in/etc/httpd/conf/httpd. conf.
The hosts file of Fedora is located in/etc/hosts.

If you want to create a folder under the root directory of the site, you must have administrator permissions and grant read/write and operation permissions.
Mkdir/var/www/html/website
Chmod-R 777/var/www/html/website
777 is the lowest permission. We recommend that you enable this permission level when creating a website. You need to modify the permission level when you need to increase the security level.

3. install PHP
Yum install php
After installing php, restart the Apache service.
Service httpd restart
Test php
Vi/var/www/html/info. php
Write, save, and exit in the editor.
Enter http: // 127.0.0.1/info. php In the browser
If the static parsing page of apache appears, the installation is successful and the mysql database cannot be connected.

4. Install Mysql support for PHP
Php5 supports MySQL easily. You only need to install the php-mysql package. However, to run the php program, you may need support from multiple php modules. For details, refer to the program description.
Use the yum search [software] command to search for the corresponding software package:
Yum searchphp
A general example is introduced:
Yum install php-mysql php-gd php-imap php-ldap php-odbc php-pearphp-p-pear php-xml php-xmlrpc php-eaccelerator php-magickwandphp-magpierss php- mbstring php-mcrypt php-mssql php-shout php-snmpphp-soap php-tidy
Restart Apache after installation:
Service httpd restart
Access http: // 127.0.0.1/info. php again, and related mysql configuration information will appear.

5. Install the mysql database management tool phpMyAdmin
Yum install phpmyadmin
Configure phpmyadmin:
Vi/etc/nttpd/conf. d/phpMyAdmin. conf
In this configuration file, the user access permissions are mainly modified.

Order deny, allow
Deny from all
Allow from 127.0.0.1

Only Local Users are allowed to access the service.

6. After LAMP is configured, the firewall needs to be set

1. enable port 80: iptables-I INPUT-p tcp -- dport 80-j ACCEPT

2. Enable the ssh service
# Systemctl start sshd. service

Start the service with the System


# Systemctl enable sshd. service

Enter setup in terminal to add port 22 to the firewall

Enable port 22 of the firewall

# Iptables-I INPUT-p tcp -- dport 22-j ACCEPT

Related reading:

Install LAMP \ Vsftpd \ Webmin \ phpMyAdmin service and set http://www.linuxidc.com/Linux/2013-06/86250.htm in Ubuntu 13.04

LAMP website acceleration optimization http://www.linuxidc.com/Linux/2013-09/90019.htm

Compile and install LAMP (Apache 2.2.44 + MySQL 5.6.10 + PHP 5.4.12) http://www.linuxidc.com/Linux/2013-03/80333p3.htm in CentOS 5.9

Source code construction of Web Server Architecture in RedHat 5.4 LAMP environment and application PHPWind http://www.linuxidc.com/Linux/2012-10/72484p2.htm

LAMP source environment to build WEB Server Linux + Apache + MySQL + PHP http://www.linuxidc.com/Linux/2013-05/84882.htm

For more information about Fedora, see Fedora topics page http://www.linuxidc.com/topicnews.aspx? Tid = 5

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.