Can I create a non-WP subdomain to existing WP site?

I created a WP site like domain.com (hostname is www.domain.com). This isn’t multisite, just standalone.
I have another standalone site on this box, another.com.

Now I need to setup a general non-public “service” type of app (not WP, just general PHP/mySQL pages similar to PHP MyAdmin, it’ll be used only by Admin for some non-WP stuff).

a) Should I create this as subdomain, say myapp.domain.com?
If yes, do I just do “ee create site myapp.domain.com” --mysql"?
or…
b) If I shouldn’t tie this to a domain that’s used in production, can I create this as domain.com/myapp? If yes, do I just put my stuff in /var/www/domain.com/htdocs/myapp?

Or is there some third, better way?
Personally I prefer B) as I’m hoping that I can just paste code into a random directory.
Assuming I don’t have any plans to use ee to delete domain.com, this would be easier as I have less DNS and sites to manage.

1 Like

A) You can create a subdomain using following command

  
ee create site myapp.domain.com --mysql  

B) domain.com/myapp
You need to create a myapp folder inside domain.com webroot

  
mkdir -p /var/www/domain.com/htdocs/myapp  

Add nginx rules for myapp

  
ee site edit domain.com  
location /myapp {  
    try_files $uri $uri/  myapp/index.php?$args;  
}  

Also you need to manually create database for myapp (if myapp required database)

Hello,
Thanks for this wonderful script, Easyengine is really easy.
I have a problem though, here is my situation:
I have created domain.com using ee site create domain.com --wpfc
made to dns records for bind9 from scratch and domain.com is working very well.
Now i wanted a wp subdomain so i created sub.domain.com using ee site create sub.domain.com --wpfc
domain.com is not multisite.
Now problem is that i cant acces sub.domain.com i am confused with the dns and nginx part here.
Can you help me with this please. There is proper tutorials for domain creating with ee but a good tutorial for dns with bind would be just great. This is the first time i am working without a control panel (i was with plesk previously) so dns and all is little trouble to me.

Thank you

Ok i have found that the sub.domain.com is up and it responds from the machine and resolves to correct ip, but this is only possible from server or some other ip address. even gtmatrix is able to load the site but i am not able to ping or load the site from my local windows machine . Dont know whats wrong, i guess dns cache might be the cause and i have no idea how to solve this issue.

Its seems like your local system DNS is not updated
Please use google DNS servers you can find more details at https://developers.google.com/speed/public-dns/docs/using

Hello @nastyraj7 and @something,

I hope your query is resolved. I am closing this support ticket for now.

Feel free to create a new support ticket if you have any queries further. :slight_smile:

1 Like