I setup Anything in My Server To Connect To A Domain But I have A Problem Httpd Virtual Host Redirect me To Default Apache Page I don’t Know Why I Tried Every Solution On Internet But Nothing works.
Here is My File If Anything Else Needed Tell me:
<VirtualHost *:80>
documentRoot /var/www/buymeacookie.ir/public_html
ServerName buymeacookie.ir
ErrorLog /var/www/buymeacookie.ir/error.log
CustomLog /var/www/buymeacookie.ir/requests.log combined
#Redirect "/" "https://www.buymeacookie.ir/"
</VirtualHost>
I Also Made /var/www/buymeacookie.ir/
and /var/www/buymeacookie.ir/public_html/
and added a index.html on public_html
But When I Open My URL I get Default Page of Apache.
thank you for reading 😀
EDIT tree of /var/www is
/var/www
├── buymeacookie.ir
│  ├── access.log
│  ├── error_log
│  ├── error.log
│  ├── public_html
│  │  └── index.html
│  └── requests.log
├── cgi-bin
└── html
2
Answers
Line 2 of your .conf file is wrong: must be
DocumentRoot
, and notdocumentRoot
this is how I would configure such a site. The requirements I figure out from your question:
/opt/apache/conf/httpd.conf
/opt/apache/conf/extra/httpd-vhosts.conf
With this setup:
http://www.example.com
orhttp://example.com
, the files will come from /var/www/example.com/public_html/Obviously, this is a starting point, you must adjust for your other requirements.