-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapache_config.txt
92 lines (50 loc) · 1.25 KB
/
apache_config.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#Apache configuration
#mysql for python
python install pip
apt-get install python-mysqldb
pip install django==1.8
#or another version
apt-get install mysql-server-5.5
apt-get install apache2
apt-get install libapache2-mod-wsgi
#Wsgi config file for django project
vi /home/ubuntu/firstweb.wsgi
#
#---------------
import os
import sys
sys.path = ['/var/www/firstweb'] + sys.path
os.environ['DJANGO_SETTINGS_MODULE'] = 'firstweb.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
#---------------
Московская 131 4** Черная дверь, 15-00
#Create apache site config file
cd /etc/apache2/sites-available
vi firstweb.conf
#---------------
<VirtualHost *:80>
WSGIScriptAlias / /home/ubuntu/firstweb.wsgi
ServerName firstweb.com
Alias /static /var/www/firstweb/static/
<Directory /var/www/firstweb/>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
#---------------
#Enable site config
a2ensite firstweb.conf
#create project django
cd /var/www/
django-admin.py startproject firstweb
ifconfig
#inet addr:192.168.0.2
#Add adresses to localhost
vi /etc/hosts
#add lines:
192.168.0.2 firstweb.com
service apache2 reload
#configure db
#go to django.settings
..