Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Jul 7, 2022
1 parent c608d60 commit bf77612
Showing 1 changed file with 84 additions and 2 deletions.
86 changes: 84 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Welcome to PHP MVC Structure by TanHongIT
# Welcome to YL MVC Structure by TanHongIT

**YL MVC Structure (PHP MVC)** is a pattern made in PHP used to implement user interfaces, data, and controlling logic.

It's built based on the combination of ideas from the Yii framework and Laravel framework (yl).

# 1. Configuration requirements

Expand All @@ -23,11 +27,89 @@ npm run build

# 4. Edit Connect Database

You need to change the connection information to the database after you have cloned my repository so that the website can work.
You need to change the connection information to the database if you want to store and use data for the website.

Path: [`/config/database.php`](https://github.com/TanHongIT/yl-mvc-structure/tree/main/config)

```php
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', '');
define('DB_NAME', 'chatapp-php');
```

# 5. Install and using ssl certificate

Using **mkcert** to create ssl certificate

### On Ubuntu

```shell
sudo apt install libnss3-tools

sudo wget https://github.com/FiloSottile/mkcert/releases/download/v1.4.3/mkcert-v1.4.3-linux-amd64 && \
sudo mv mkcert-v1.4.3-linux-amd64 mkcert && \
sudo chmod +x mkcert && \
sudo cp mkcert /usr/local/bin/
```

Now that the mkcert utility is installed, run the command below to generate and install your local CA:

```shell
mkcert -install
```

### Create ssl certificate for this project

Run:

```shell
cd /var/www/certs
mkcert local.yl_mvc_structure.com
```

### Update configuration

Change **local.yl_mvc_structure.com.conf** file (/apache2/sites-available/ to this)

```
<VirtualHost *:80>
ServerAdmin localserver@localhost
ServerName local.yl_mvc_structure.com
ServerAlias www.yl_mvc_structure.vdx.com
DocumentRoot /var/www/yl_mvc_structure
ErrorLog /var/www/logs/error-yl_mvc_structure.log
CustomLog /var/www/logs/access-yl_mvc_structure.log combined
</VirtualHost>
<VirtualHost *:443>
ServerAdmin localserver@localhost
ServerName local.yl_mvc_structure.com
ServerAlias www.local.yl_mvc_structure.com
DocumentRoot /var/www/yl_mvc_structure
ErrorLog /var/www/logs/error-yl_mvc_structure.log
CustomLog /var/www/logs/access-yl_mvc_structure.log combined
SSLEngine on
SSLCertificateFile /var/www/certs/local.yl_mvc_structure.com.pem
SSLCertificateKeyFile /var/www/certs/local.yl_mvc_structure.com-key.pem
<Directory /var/www/yl_mvc_structure>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
```

When done, you can test the website by opening the browser and typing the following URL:

```shell
https://local.yl_mvc_structure.com

https://local.yl_mvc_structure.com/product
https://local.yl_mvc_structure.com/product/all
https://local.yl_mvc_structure.com/product/show/1
...
```

0 comments on commit bf77612

Please sign in to comment.