Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure Apache to build LMAP Architecture

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Overview of LAMP 1.1.What is LAMP? LAMP architecture is a group of open source software commonly used by Linux+Apache+Mysql/MariaDB+Perl/PHP/Python to build dynamic websites or servers, which are independent programs themselves, but because they are often used together, they have a higher and higher degree of compatibility and form a powerful Web application platform. With the vigorous development of open source trend, open source LAMP has formed a tripod with J2EE and .net commercial software, and the project developed by this software has a low investment cost, so it has attracted the attention of the whole IT community. In terms of website traffic, more than 70% of the visit traffic is provided by LAMP, and LAMP is the most powerful website solution. 1.2.The Linux operating system, which is the component of LAMP architecture platform, is the foundation of LAMP architecture and is used to support the operating system of Web sites. it has good stability and compatibility. Apache website server is the front end of LAMP architecture, powerful and stable Web server programs, providing users with website access, sending web pages, files, pictures and other content MySQL database server: it is the back end of LAMP architecture. Open source relational database system, data is stored in MySQL database, PHP, Python, Perl programming languages can be queried through SQL statements: dynamic web programming language, used to interpret dynamic web page files, and provide a development and running environment for Web applications. PHP is a widely used open source multi-purpose scripting language, which can be embedded in HTML and is suitable for Web application development. Second, the preparation for setting up LAMP 2.1.The installation packages needed for downloading the installation package are as follows: I can connect to my IP:192.168.56.1 remotely. There is a shared file lamp7 installation package in it. If you have an installation package, you don't need to download it, and you can't download it in this file. Install ApacheApache HTTP Server (Apache for short) is an open source web server of the Apache Software Foundation, which can run in most computer operating systems. Because of its wide use of multi-platform and security, it is one of the most popular Web server-side software. It is fast, reliable and can compile interpreters such as Perl/Python into the server through a simple API extension.

Apache HTTP server is a modular server, derived from NCSAhttpd server, after many modifications, it has become the number one Web server software in the world. In order to avoid program conflicts, first check whether httpd is installed in the way of rpm. Rpm-Q httpd

If it already exists, the installation packages used to uninstall httpdApache are: apr-1.6.2.tar.gz, apr-util-1.6.0.tar.gz, httpd-2.4.29.tar.gz. Manually compile and install the environment so that the computer has the function of compiling the source code package, so install it in advance: gcc, gcc-c++, make, pcre-devel, expat-devel, perl. 3.1.Create mount point / abc Mount mount shared file [root@localhost ~] # mkdir / abc / / mount point created: / abc [root@localhost ~] # mount.cifs / / 192.168.56.1/lamp7 / abc / / mount shared file "lamp7" / / the IP address of my host (windows system) is: 192.168.56.1 [root@localhost ~] # cd / abc/ [root@localhost ~] # ls / / there is a LAMP file in it

Extract the related files to / opt/, and add the two plug-ins Move to the extracted httpd-2.4.29 folder [root@localhost LAMP-C7] # tar zxvf apr-1.6.2.tar.gz-C / opt/ [root@localhost LAMP-C7] # tar zxvf apr-util-1.6.0.tar.gz-C / opt/ [root@localhost LAMP-C7] # tar jxvf httpd-2.4.29.tar.bz2-C / opt [root@localhost LAMP-C7] # cd / opt/ [root@localhost opt ] # mv apr-1.6.2/ httpd-2.4.29/srclib/apr [root@localhost opt] # mv apr-util-21.6.0/ httpd-2.4.29/srclib/apr-util / / Note: move to the httpd-2.4.29/srclib/ directory

Note: move to the httpd-2.4.29/srclib/ directory and install the compilation tool [root@localhost opt] # vim install gcc gcc-c++ make pcre-devel pcre expat-devel perl-y

Configuration: custom installation. Note the path [root@localhost httpd-2.4.29] #. / configure\-- prefix=/usr/local/httpd\-- enable-so\-- enable-rewrite\-- enable-charset-lite\-- enable-cgi

-- prefix specifies the directory where the httpd service program is installed. (/ usr/local/httpd is installed here)

-- enable-so enables core modules

-- enable-rewrite enables web address rewriting

-- enable-charset-lite startup character set support

-- enable-cgi enables CGI scripting support

3.5. keep the path unchanged, configure make [root@localhost httpd-2.4.29] # make3.6 and make, then install make install. Similarly, the path remains unchanged [root@localhost httpd-2.4.29] # make instll3.7, and turn off the firewall first. Modify configuration file / / # turn off firewall [root@localhost httpd-2.4.29] # systemctl stop firewalld.service [root@localhost httpd-2.4.29] # setenforce 0ram / copy a file to / etc/init.d/httpd file [root@localhost httpd-2.4.29] # cp / usr/local/httpd/bin/apachectl / etc/init.d/httpd [root@localhost httpd-2.4.29] # vim / etc/init.d / httpd / / enter file modification and add two lines of comments / / 35 level automatic run 85th startup 21st shutdown # chkconfig: 35 85 21 # description: Apache is a World Wide Web server

3.8. chkconfig-- add httpd/ / add httpd to SERVICE Manager chkconfig-- add httpd/ / add httpd to SERVICE Manager 3.9, create soft links, optimize the path [root@localhost init.d] # ln-s / usr/local/httpd/conf/httpd.conf / etc/httpd.cong [root@localhost init.d] # ln-s / usr/local/httpd/bin/* / usr/local/bin/// create soft links to facilitate system identification

3.10. Configure vim / usr/local/httpd/conf/httpd.conf and add the following two lines:

ServerName www.test.com:80 (this is customized, 80 represents port) Listen 192.168.220.131 Listen 80 (listening address, this is customized according to your own configuration environment, 80 represents port) Note: you can type: / ServerName in command mode to quickly find this line

Enter: / Listen to find the listening address line

3.11. Verify whether there are errors in the configuration file [root@localhost init.d] # httpd-t [root@localhost init.d] # apachectl-t

)

3.12. Start the service and view port 80 [root@localhost init.d] # service httpd start [root@localhost init.d] # netstat-anpt | grep httpd

3.13. Final verification: the following words appear, that is, the Apache is configured successfully

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report