-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlamp.txt
197 lines (165 loc) · 5.46 KB
/
lamp.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# MAIN APACHE2 CONFIG START
sudo mkdir /var/www/production
sudo mkdir /var/www/staging
sudo mkdir /var/www/production/api
sudo mkdir /var/www/production/admin
sudo mkdir /var/www/production/customer
sudo mkdir /var/www/staging/api
sudo mkdir /var/www/staging/admin
sudo mkdir /var/www/staging/customer
sudo mkdir /var/www/production/admin/dist
sudo mkdir /var/www/production/customer/dist
sudo mkdir /var/www/staging/admin/dist
sudo mkdir /var/www/staging/customer/dist
sudo mkdir /var/www/production/admin/dist/trucktransport
sudo mkdir /var/www/production/customer/dist/trucktransport
sudo mkdir /var/www/staging/admin/dist/trucktransport
sudo mkdir /var/www/staging/customer/dist/trucktransport
sudo mkdir /var/www/production/admin-logs
sudo mkdir /var/www/production/customer-logs
sudo mkdir /var/www/staging/admin-logs
sudo mkdir /var/www/staging/customer-logs
sudo chown -R $USER:$USER /var/www/production/api
sudo chown -R $USER:$USER /var/www/production/admin
sudo chown -R $USER:$USER /var/www/production/customer
sudo chown -R $USER:$USER /var/www/staging/api
sudo chown -R $USER:$USER /var/www/staging/admin
sudo chown -R $USER:$USER /var/www/staging/customer
sudo nano /etc/apache2/sites-available/production_admin.conf
<VirtualHost *:80>
ServerName 127.0.0.1
ServerAlias 127.0.0.1
ServerAdmin webmaster@127.0.0.1
DocumentRoot /var/www/production/admin/dist/trucktransport
ErrorLog /var/www/production/admin-logs/error.log
CustomLog /var/www/production/admin-logs/access.log combined
<Directory /var/www/production/admin/dist/trucktransport>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
# Order allow,deny
Require all granted
</Directory>
</VirtualHost>
sudo nano /etc/apache2/sites-available/production_customer.conf
<VirtualHost *:8080>
ServerName 127.0.0.1
ServerAlias 127.0.0.1
ServerAdmin webmaster@127.0.0.1
DocumentRoot /var/www/production/customer/dist/trucktransport
ErrorLog /var/www/production/customer-logs/error.log
CustomLog /var/www/production/customer-logs/access.log combined
<Directory /var/www/production/customer/dist/trucktransport>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
# Order allow,deny
Require all granted
</Directory>
</VirtualHost>
sudo nano /etc/apache2/sites-available/staging_admin.conf
<VirtualHost *:4200>
ServerName 127.0.0.1
ServerAlias 127.0.0.1
ServerAdmin webmaster@127.0.0.1
DocumentRoot /var/www/staging/admin/dist/trucktransport
ErrorLog /var/www/staging/admin-logs/error.log
CustomLog /var/www/staging/admin-logs/access.log combined
<Directory /var/www/staging/admin/dist/trucktransport>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
# Order allow,deny
Require all granted
</Directory>
</VirtualHost>
sudo nano /etc/apache2/sites-available/staging_customer.conf
<VirtualHost *:4201>
ServerName 127.0.0.1
ServerAlias 127.0.0.1
ServerAdmin webmaster@127.0.0.1
DocumentRoot /var/www/staging/customer/dist/trucktransport
ErrorLog /var/www/staging/customer-logs/error.log
CustomLog /var/www/staging/customer-logs/access.log combined
<Directory /var/www/staging/customer/dist/trucktransport>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
# Order allow,deny
Require all granted
</Directory>
</VirtualHost>
sudo a2ensite production_admin
sudo a2ensite production_customer
sudo a2ensite staging_admin
sudo a2ensite staging_customer
sudo a2dissite 000-default
sudo apache2ctl configtest
sudo systemctl reload apache2
sudo nano /var/www/production/admin/index.html
<html>
<head>
<title>production_admin</title>
</head>
<body>
<h1>production_admin</h1>
</body>
</html>
sudo nano /var/www/production/customer/index.html
<html>
<head>
<title>production_customer</title>
</head>
<body>
<h1>production_customer</h1>
</body>
</html>
sudo nano /var/www/staging/admin/index.html
<html>
<head>
<title>staging_admin</title>
</head>
<body>
<h1>staging_admin</h1>
</body>
</html>
sudo nano /var/www/staging/customer/index.html
<html>
<head>
<title>staging_customer</title>
</head>
<body>
<h1>staging_customer</h1>
</body>
</html>
sudo systemctl reload apache2
sudo nano /etc/apache2/ports.conf
Listen 8080
Listen 8000
Listen 4200
Listen 4201
# should be directly listened from pm2
#Listen 3000
#Listen 3001
# MAIN APACHE2 CONFIG DONE
sudo cp -r /git/api-repo /var/www/production/api
sudo cp -r /git/admin-repo /var/www/production/admin
sudo cp -r /git/customer-repo /var/www/production/customer
sudo cp -r /git/api-repo /var/www/staging/api
sudo cp -r /git/admin-repo /var/www/staging/admin
sudo cp -r /git/customer-repo /var/www/staging/customer
mv /var/www/from /var/www/to
ng build --configuration=development
ng build --configuration=staging
ng build --configuration=production
npm run build --configuration=development
npm run build --configuration=staging
npm run build --configuration=production
https://julianpoemp.github.io/ngx-htaccess-generator/#/generator
sudo nano /var/www/production/admin/build.sh
https://julianpoemp.github.io/ngx-htaccess-generator/#/generator
sudo systemctl status lighttpd
sudo systemctl start lighttpd
sudo systemctl stop lighttpd
sudo systemctl restart lighttpd
sudo service apache2 status
sudo service apache2 start
sudo service apache2 stop
sudo service apache2 restart
sudo a2enmod rewrite