0
|
1 # HowTo install the selfhost api variant on Apache
|
|
2
|
|
3 First you want to install the apache2.
|
|
4 ```bash
|
|
5 sudo apt-get install apache2
|
|
6 ```
|
|
7 After install all of the relevent apache modules:
|
|
8 ```bash
|
|
9 sudo apt-get -y install php7.4-mysql php7.4-curl php7.4-gd php7.4-intl php-pear php-imagick php7.4-imap php-memcache
|
|
10 ```
|
|
11 Then install certbot for free ssl certs :
|
|
12 ```bash
|
|
13 sudo apt-get install -y certbot
|
|
14 ```
|
|
15 After this then create a basic site config for the fake api server, do this by creating a file under /etc/apache2/sites-enabled/000-default-le-ssl.conf with the example conf [example](docs/apache/000-default-le-ssl.conf).
|
|
16
|
|
17 Then generate a ssl certificate for the website with certbot.
|
|
18 ```bash
|
|
19 sudo certbot -d [PUBLIC_ACCESSIBLE_API_DOMAIN]
|
|
20 ```
|
|
21 Once this is done you should check if you have all of the required loaded php modules required for this server. You can check this by running `sudo apache2ctl -M` and the output should look be something like
|
|
22 ```
|
|
23 sudo apache2ctl -M
|
|
24 Loaded Modules:
|
|
25 core_module (static)
|
|
26 so_module (static)
|
|
27 watchdog_module (static)
|
|
28 http_module (static)
|
|
29 log_config_module (static)
|
|
30 logio_module (static)
|
|
31 version_module (static)
|
|
32 unixd_module (static)
|
|
33 access_compat_module (shared)
|
|
34 alias_module (shared)
|
|
35 auth_basic_module (shared)
|
|
36 authn_core_module (shared)
|
|
37 authn_file_module (shared)
|
|
38 authz_core_module (shared)
|
|
39 authz_host_module (shared)
|
|
40 authz_user_module (shared)
|
|
41 autoindex_module (shared)
|
|
42 deflate_module (shared)
|
|
43 dir_module (shared)
|
|
44 env_module (shared)
|
|
45 filter_module (shared)
|
|
46 http2_module (shared)
|
|
47 mime_module (shared)
|
|
48 mpm_prefork_module (shared)
|
|
49 negotiation_module (shared)
|
|
50 php7_module (shared)
|
|
51 proxy_module (shared)
|
|
52 proxy_fcgi_module (shared)
|
|
53 reqtimeout_module (shared)
|
|
54 rewrite_module (shared)
|
|
55 setenvif_module (shared)
|
|
56 socache_shmcb_module (shared)
|
|
57 ssl_module (shared)
|
|
58 status_module (shared)
|
|
59 ```
|
|
60
|
|
61 Then clone this repo if you've not done this already and `cd` into the root of the project:
|
|
62 ```bash
|
|
63 git clone https://gitlab.simonmicro.de/simonmicro/pritunl-fake-api.git
|
|
64 cd ./pritunl-fake-api
|
|
65 ```
|
|
66 After this is done copy over the API server files to the server and set permissions
|
|
67 ```bash
|
|
68 sudo cp -R ./www/* /var/html/
|
|
69 sudo chown www-data:www-data -R /var/www/html
|
|
70 sudo chmod -R 774 /var/www/html/
|
|
71 ```
|
|
72 Then restart apache2 to make sure all of the configuration is loaded
|
|
73 ```bash
|
|
74 sudo systemctl restart apache2
|
|
75 ```
|
|
76 Once this is done you should get a response when you visit `https://[PUBLIC_ACCESSIBLE_API_DOMAIN]/notification`!
|