简体   繁体   中英

Add subdomain on Apache2

I want to add a subdomain api.example.com on Apache2.
Here is my configuration file for the domain.

<VirtualHost *:80>
    ServerName api.winity.pw
    ServerAdmin webmaster@winity.pw
    DocumentRoot /var/www/api

    ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost> 

I tried to access it without working, here is my DNS configuration on CloudFlare 1

When I try to access it, I find myself in the /var/www/public directory and not /var/www/api .

First when asking here.

  1. Google the question
  2. Search on StackOverflow
  3. Make a relevant title for you Create subdomain in Apache2
  4. Specify your operating system not your type of server**

Use 443 port over SSL by changing <VirtualHost *:80> to <VirtualHost *:443> .

If you receive an HTTP 525 - SSL Handshake failed error from CloudFlare , use Flexible SSL option. This append when you use Full SSL and you don't have a valid SSL certificat on your server.

1

For fix this issue, change the SSL option to Flexible .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM