The twists and turns of LAMP installation on Linux
Source: Internet
Author: User
How to install LAMP on a Linux platform-Linux Enterprise Application-Linux server application information. I won't talk much about Linux installation. N was installed earlier. Recently, I started to learn php and naturally had to have a local test environment. However, the installation process is still difficult.
Editor's note: LAMP is short for Linux + apache + mysql + php.
First download the httpd-2.2.6 on the official site of apache, decompress the package and start to compile, pay attention to the use of dso
./Configure -- enable-so
Make
Make install
During the first installation, I forgot to make install, which is always unsuccessful. After installation, you can use the following command to start and stop apache.
/Usr/local/apache2/bin/apachectl start
/Usr/local/apache2/bin/apachectl stop
Normally, the words It works appear when accessing 127.0.0.1, which may vary with systems. Stop apache and start mysql installation. Because the mysql path needs to be specified during php compilation, install this first. Create an account first:
Useradd mysql
Groupadd-g mysql
Compilation process is similar
./Configure
Make
Make install
Then set
/Usr/local/mysql/scripts/mysql_install_db -- user = mysql
It is really a ghost of SELinux's new features. I set the directory or file to the user_home_t type, so the apache process has no permissions and cannot be accessed. SELinux target policy for Apache processes specifies that apache processes can only access directories or files of the httpd_sys_content_t type.
Solution:
Simply change the policy type of the directory or file to httpd_sys_content_t.
Use root User
# Chcon-t httpd_sys_content_t directory name or file name
Then you can run the ls-laZ command to view the policy type of the file directory. Then configure httpd. conf. There are too many content on the Internet, and I am too lazy to do so. I will finish this. mysql will solve it later.
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