OS: CentOS 8
Target:
- PHP 7.4
- PHP-FPM
- Apache 2.4.46
- OpenSSL 1.1.1g
Start compile
| sudo dnf install install -y gcc gcc-c++ make prec-devel libtool perl-core zlib-devel |
| |
| |
| sudo ./configure --prefix=/usr/local/apr |
| sudo make |
| sudo make install |
| |
| |
| sudo ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr |
| sudo make |
| sudo make install |
| |
| |
| sudo ./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl shared zlib |
| sudo make |
| sudo make install |
| |
| |
| sudo ./configure --prefix=/usr/local/apache2446 --enable-so --enable-ssl --enable-cgi --enable-rewrite --enable-modules=most --enable-mpms-shared=all --with-mpm=prefork --with-zlib --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-ssl=/usr/local/openssl |
| sudo make |
| sudo make install |
| |
| |
| |
| |
| sudo vim /etc/profile.d/httpd.sh |
| |
| |
| pathmunge /usr/local/apache2446/bin |
| |
| |
| |
| |
| sudo vim /etc/systemd/system/httpd.service |
paste the following content, save and exit.
| [Unit] |
| Description=The Apache HTTP Server |
| After=network.target |
| |
| [Service] |
| Type=forking |
| ExecStart=/usr/local/apache2446/bin/apachectl -k start |
| ExecReload=/usr/local/apache2446/bin/apachectl -k graceful |
| ExecStop=/usr/local/apache2446/bin/apachectl -k graceful-stop |
| PIDFile=/usr/local/apache2446/logs/httpd.pid |
| PrivateTmp=true |
| |
| [Install] |
| WantedBy=multi-user.target |
| |
| sudo systemctl daemon-reload |
| |
| |
| sudo systemctl start httpd |
| sudo systemctl enable httpd |
| |
| |
| sudo dnf install -y http://rpms.remirepo.net/enterprise/remi-release-8.rpm |
| dnf module reset php |
| dnf module install -y php:remi-7.4 |
| |
| sudo service php-fpm start |
| sudo systemctl enable php-fpm |
Reference
沒有留言:
張貼留言