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

LAMP compilation and installation

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Before installation, you should first install the required dependent libraries, upload the required source packages such as httpd mysql php to the host, or download and upload directly by wget and download wget without introduction. Some of these dependencies can be compiled and installed or yum installed, and the dependencies here are not fully written. This includes a must, such as cmak gcc.

Install dependent libraries

Yum install-y gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libpng libpng-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses curl openssl-devel gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel readline-devel libxslt-devel expat-devel xmlrpc-c xmlrpc-c-devel cmake

You need to install httpd2.4.x before you start compiling and installing apr apr-util. I'm used to unpacking all packages before installing.

Ls * .tar.gz | xargs-N1 tar xvf # this command installs aprcd apr-1.5.2/./configure-- prefix=/usr/local/aprmake & & make install installation apr-utilcd apr-util-1.5.4/./configure-- prefix=/usr/local/apr-util-- with-apr=/usr/local/apr/make & & make install installation pcrecd pcre-8.39/./configuremake & & maek install installation apachecd in the current folder of the package. Httpd-2.4.25/./configure-prefix=/usr/local/apache-sysconfdir=/etc/httpd-enable-so--enable-ssl-enable-cgi-enable-rewrite-with-zlib-with-pcre--with-apr=/usr/local/apr with-apr-util=/usr/local/apr-util--enable-mpms-shared=all with-mpm=event

It is also written here, and the parameters here are defined according to your own situation. Some instructions can be added without adding or adding others:-- prefix=/usr/local/apache # httpd installation path

-- sysconfdir=/etc/httpd # system configuration file directory path

-- enable-so # supports shared module functionality

-- enable-ssl # supports ssl function

-- enable-cgi # support cgi function

-- enable-rewrite # support rewriting function

-- with-zlib # supports extended library file function

-- with-pcre # supports pcre function if there is a specified path for pcre compilation and installation-- with-apr=/usr/local/apr # specifies the apr installation path

-- with-apr-util=/usr/local/apr-util # specify the apr-util installation path

-- enable-mpms-shared=all # means that all mpm modules for this platform will be installed

-- with-mpm=event # specially designated mpm module as event,mpm module can be modified in the configuration file

Cp / usr/local/apache/bin/apachectl / etc/init.d/httpd add apache to boot vi / etc/init.d/httpd #! / bin/sh add otherwise chkconfig-add httpd will error # chkconfig:2345 90 17 90 17 is the order of boot / shutdown loading # description: it doesn't matter what is written here, execute the command to boot httpd chkconfig-- add httpdchkconfig httpd on

After successful installation, turn off the firewall or port 80 to join the iptables, because the domain name has not been configured, enter the host address to access, such as it works! Indicates that apache is installed successfully, and then install mysql php

Mysql installation groupadd mysql creation group useradd-g mysql mysql # if you are forbidden to log in to the system, add the parameter-s / sbin/nologinmkdir-p / data/mysqldb # database storage directory mkdir-p / usr/local/mysql # database installation directory cd mysql-5.6.35/cmake\-DCMAKE_INSTALL_PREFIX=/usr/local/mysql\-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock\-DDEFAULT_CHARSET=utf8\-DDEFAULT_COLLATION=utf8_general _ ci\-DWITH_MYISAM_STORAGE_ENGINE=1\-DWITH_INNOBASE_STORAGE_ENGINE=1\-DWITH_ARCHIVE_STORAGE_ENGINE=1\-DWITH_BLACKHOLE_STORAGE_ENGINE=1\-DWITH_MEMORY_STORAGE_ENGINE=1\-DWITH_READLINE=1\-DENABLED_LOCAL_INFILE=1\-DMYSQL_DATADIR=/data/mysqldb\-DMYSQL_USER=mysql\-DENABLE_DOWNLOADS=1make & & make install Note: reconfigure Delete CMakeCache.txt files and modify the database installation directory and database file directory permissions cd / usr/local/mysql/chown-R mysql:mysql .cd / data/mysqldb/chown-R mysql:mysql. Initialize MySQL database cd / usr/local/mysqlscripts/mysql_install_db-- user=mysql-- datadir=/data/mysqldb replication mysql service startup configuration file cp / usr/local/mysql/support-files/my-default.cnf / etc/my.cnf replication mysql service startup script cp support-files/mysql.server / etc/init.d/mysqldchkconfig-- add mysqldchkconfig mysqld on adds mysql to the PATH path vi / etc/profilePATH=/usr/local/mysql/bin:/usr/local / mysql/lib:$PATHexport PATHsource / etc/profileservice mysqld start start MySQLmysql-uroot-p enter MySQL default empty password directly enter mysqladmin-uroot password 'rootroot' modify MySQL password to allow MySQL remote login to MySQL > GRANT ALL PRIVILEGES ON *. * TO root@ "%" IDENTIFIED BY "rootroot" Mysql > flush privileges / configure-- prefix=/usr/local/php-- with-mysql=/usr/local/mysql-- with-openssl--with-mysqli=/usr/local/mysql/bin/mysql_config-- enable-mbstring--with-freetype-dir-- with-jpeg-dir-- with-png-dir-- with-zlib--with-libxml-dir=/usr-- enable-xml-- enable-sockets--with-apxs2=/usr/local/apache/bin/apxs-- with-mcrypt--with-config -file-path=/etc-- with-config-file-scan-dir=/etc/php.d-- with-bz2-- enable-maintainer-zts this parameter is more comprehensive It contains mcrypt. If this parameter is not removed, the dependent libraries such as libmcrypt need to be installed. If it is not available for the time being, you can remove this parameter makemake installcp php.ini-production / etc/php.inivi / etc/httpd/httpd.conf and add the following two lines: AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps. If you cannot parse the PHP file and add PHPIniDir / etc/php.ini restart apache at the end, you can parse normally. The above is the LAMP compilation step. There will be problems and parameters introduction, which will be introduced in another article. The problems encountered are usually configuration errors or lack of dependent libraries, which can be solved by self-search.

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

Database

Wechat

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

12
Report