Merge branch 'master' into develop

pull/142/MERGE
13621160019@163.com 2022-04-22 17:56:20 +08:00
commit 513f283fa2
3 changed files with 26 additions and 5 deletions

View File

@ -5,13 +5,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased] ## [Unreleased]
### Added ### Added
- None. - added API reverse proxy in Apache conf.
### Changed ### Changed
- None. - replaced true with 1 in SQL statements of myems-api.
- updated user insert sql statement for failed_login_count.
### Fixed ### Fixed
- None. - fixed typo in virtualmetercarbon.
### Removed ### Removed
- None. - None.

View File

@ -164,7 +164,7 @@ Listen 8001
sudo vi /etc/apache2/sites-available/000-default.conf sudo vi /etc/apache2/sites-available/000-default.conf
``` ```
Add a new 'VirtualHost' as below Add a new 'VirtualHost' as below
```xml ```
<VirtualHost 127.0.0.1:8001> <VirtualHost 127.0.0.1:8001>
ServerAdmin MyEMS-admin ServerAdmin MyEMS-admin
DocumentRoot /var/www/myems-admin DocumentRoot /var/www/myems-admin
@ -173,9 +173,19 @@ Add a new 'VirtualHost' as below
Options FollowSymLinks Options FollowSymLinks
AllowOverride All AllowOverride All
Require all granted Require all granted
Header set Access-Control-Allow-Origin *
</Directory> </Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order Deny,Allow
Allow from all
</Proxy>
ProxyPass /api http://127.0.0.1:8000/
ProxyPassReverse /api http://127.0.0.1:8000/
</VirtualHost> </VirtualHost>
``` ```

View File

@ -230,9 +230,19 @@ Add a new 'VirtualHost' as below
Options FollowSymLinks Options FollowSymLinks
AllowOverride All AllowOverride All
Require all granted Require all granted
Header set Access-Control-Allow-Origin *
</Directory> </Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order Deny,Allow
Allow from all
</Proxy>
ProxyPass /api http://127.0.0.1:8000/
ProxyPassReverse /api http://127.0.0.1:8000/
</VirtualHost> </VirtualHost>
``` ```
@ -266,7 +276,7 @@ sudo vi .htaccess
``` ```
Add a IfModule as below: Add a IfModule as below:
```bash ```bash
IfModule mod_rewrite.c> <IfModule mod_rewrite.c>
RewriteEngine On RewriteEngine On
RewriteBase / RewriteBase /
RewriteRule ^index\.html$ - [L] RewriteRule ^index\.html$ - [L]