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
When I try to access it, I find myself in the /var/www/public
directory and not /var/www/api
.
First when asking here.
Create subdomain in Apache2
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.
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.