圖片服務(wù)器上安裝一個(gè)http服務(wù)
軟件準(zhǔn)備:
apr-1.5.2.tar.gz httpd-2.4.25.tar.gz mod_ftp-0.9.6-beta.tar.gz
apr-iconv-1.2.1.tar.gz pcre-8.40.tar.gz
apr-util-1.5.4.tar.gz mod_fcgid-2.3.9.tar.gz
解壓軟件:
tar -zxf apr-1.5.2.tar.gz
tar -zxf httpd-2.4.25.tar.gz
tar -zxf pcre-8.40.tar.gz
tar -zxf apr-util-1.5.4.tar.gz
tar -zxf mod_ftp-0.9.6-beta.tar.gz
tar -zxf apr-iconv-1.2.1.tar.gz
tar -zxf mod_fcgid-2.3.9.tar.gz
查看:ls
[root@smqq Apache]# ls
apr-1.5.2 apr-util-1.5.4.tar.gz mod_fcgid-2.3.9.tar.gz
apr-1.5.2.tar.gz httpd-2.4.25 mod_ftp-0.9.6
apr-iconv-1.2.1 httpd-2.4.25.tar.gz mod_ftp-0.9.6-beta.tar.gz
apr-iconv-1.2.1.tar.gz install pcre-8.40
apr-util-1.5.4 mod_fcgid-2.3.9 pcre-8.40.tar.gz
[root@smqq Apache]#
安裝
apr:
[root@smqq Apache]# cd apr-1.5.2
[root@smqq apr-1.5.2]#./configure --prefix=/home/Apache/install/apr
[root@smqq apr-1.5.2]#make
[root@smqq apr-1.5.2]#make install
apr-util:
[root@smqq Apache]# cd apr-util-1.5.4
[root@smqq apr-util-1.5.4]#./configure --prefix=/home/Apache/install/apr-util -with-apr=/home/Apache/install/apr/bin/apr-1-config
[root@smqq apr-util-1.5.4]#make
[root@smqq apr-util-1.5.4]#make install
pcre-8.40:
[root@smqq Apache]# cd pcre-8.40
[root@smqq pcre-8.40]#./configure --prefix=/home/Apache/install/pcre
[root@smqq pcre-8.40]#make
[root@smqq pcre-8.40]#make install
下面是apache 的安裝了 可能會(huì)出現(xiàn)各種的錯(cuò)誤肢娘,我們一步步來
httpd-2.4.25 :
[root@smqq Apache]# cd httpd-2.4.25
[root@smqq httpd-2.4.25]# ./configure --prefix=/home/Apache/install/httpd-2.4.25
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure:
configure: Configuring Apache Portable Runtime library...
configure:
checking for APR... no
configure: error: APR not found. Please read the documentation.
[root@smqq httpd-2.4.25]#
這里提示說apr 沒有找到,我們之前安裝過了,為什么戚篙?
找下原因:
原來需要添加 with 命令
[root@smqq httpd-2.4.25]# ./configure --prefix=/home/Apache/install/httpd-2.4.25 --with-apr=/home/Apache/install/apr --with-apr-util=/home/Apache/install/apr-util --with-pcre=/home/Apache/install/pcre
[root@smqq httpd-2.4.25]#make
[root@smqq httpd-2.4.25]#make install
至此安裝的步驟已經(jīng)完成了践啄,下面啟動(dòng)啟動(dòng)測試
?啟動(dòng)Apache:/home/Apache/install/httpd-2.4.25/bin/apachectl start
?停止Apache:/home/Apache/install/httpd-2.4.25/bin/apachectl stop
?重啟Apache:/home/Apache/install/httpd-2.4.25/bin/apachectl restart
啟動(dòng):
[root@smqq httpd-2.4.25]# /home/Apache/install/httpd-2.4.25/bin/apachectl start
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
[root@smqq httpd-2.4.25]#
他讓設(shè)置一個(gè)服務(wù)的名稱欲诺,我們找到httpd.conf配置一下servername
[root@smqq conf]# vim /home/Apache/install/httpd-2.4.25/conf/httpd.conf
[root@smqq conf]#
找到注釋的地方 Servername 修改成你的ip脊另,或者127.0.0.1戚绕,或者localhost
ServerName 172.16.3.86:80
再次啟動(dòng):
[root@smqq conf]# /home/Apache/install/httpd-2.4.25/bin/apachectl start
httpd (pid 57862) already running
[root@smqq conf]#
測試一下瀏覽器打開:
http://172.16.3.86/
映射靜態(tài)文件
到這里服務(wù)器搭建成功了塘娶,但是我們需要的是一個(gè)能夠訪問靜態(tài)文件的服務(wù)器归斤,所以還需要將本地文件映射到apache服務(wù)器上。
接下來一步步進(jìn)行映射配置:
找到一個(gè)配置刁岸,參照這個(gè)配置我們從新設(shè)置下conf文件
先停掉服務(wù)
[root@smqq conf]# /home/Apache/install/httpd-2.4.25/bin/apachectl stop
[root@smqq conf]# vim /home/Apache/install/httpd-2.4.25/conf/httpd.conf
[root@smqq conf]# /home/Apache/install/httpd-2.4.25/bin/apachectl start
到現(xiàn)在服務(wù)的所有配置都已經(jīng)搞定等待遠(yuǎn)程訪問圖片就好了
點(diǎn)波關(guān)注 系統(tǒng)搭建(docker)