導出虛擬環(huán)境依賴及Apache配置
你在本地把所有依賴都弄到一個文件中 pip freeze > requirements.txt,把該文件上傳到服務(wù)器。
然后再在服務(wù)器上先新建一個python虛擬環(huán)境,再激活虛擬環(huán)境,切換到requirements.txt文件夾目錄下,
通過 pip install -r requirements.txt就會把所有依賴全部裝上。
==================================================
232 Listen 81
233 <VirtualHost 172.17.87.198:81>
234 ServerAdmin webmaster@dummy-host2.example.com
235 DocumentRoot "/home/HT/yadong/"
236 #ErrorLog "/home/HT/yadong/log"
237 #CustomLog "logs/dummy-host2.example.com-access_log common"
238 </VirtualHost>
=================================================
首先安裝apache:
sudo apt-get install apache2
安裝完畢后,重啟下服務(wù):
/etc/init.d/apache2 restart
輸入你的密碼,屏幕顯示如下字樣表示重啟完畢:
[....] Restarting apache2 (via systemctl): apache2.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart ‘a(chǎn)pache2.service‘.
Authenticating as: Wagner,,, (wagner)
Password:
==== AUTHENTICATION COMPLETE ===
. ok
然后,使用瀏覽器輸入127.0.0.1試一下能否進入apache的歡迎界面,如果進入,則表示apache安裝成功。
==========================================================
ht@HT:/etc/apache2$ /etc/init.d/apache2 start
[....] Starting apache2 (via systemctl): apache2.serviceFailed to start apache2.service: Connection timed out
See system logs and 'systemctl status apache2.service' for details.
failed!
ht@HT:/etc/apache2$ cat /var/log/messages | grep httpd
cat: /var/log/messages: No such file or directory
ht@HT:/etc/apache2$ systemctl --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
● systemd-modules-load.service loaded failed failed Load Kernel Modules
● ureadahead.service loaded failed failed Read required files in advance
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
2 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
ht@HT:/etc/apache2$ systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: inactive (dead) since 日 2018-01-28 15:03:50 CST; 13min ago
Docs: man:systemd-sysv-generator(8)
1月 28 15:03:50 HT apache2[4316]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]
1月 28 15:03:50 HT apache2[4316]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.
1月 28 15:03:50 HT apache2[4316]: no listening sockets available, shutting down
1月 28 15:03:50 HT apache2[4316]: AH00015: Unable to open logs
1月 28 15:03:50 HT apache2[4316]: Action 'start' failed.
1月 28 15:03:50 HT apache2[4316]: The Apache error log may have more information.
1月 28 15:03:50 HT apache2[4316]: *
1月 28 15:03:50 HT apache2[4344]: * Stopping Apache httpd web server apache2
1月 28 15:03:50 HT apache2[4344]: *
1月 28 15:03:50 HT systemd[1]: Started LSB: Apache2 web server.
==============================>不能和boa服務(wù)器一塊運行需關(guān)閉一個
===========================
153 <Directory />
154 Options FollowSymLinks
155 AllowOverride None
156 #Require all denied 此處如果更換端口其他設(shè)置沒問題192.168.1.12:81無法權(quán)限訪問更改此處
157 Require all granted
158 </Directory>
==========================>

浙公網(wǎng)安備 33010602011771號