I successfully created an Apache Virtual Host on my dedi for Subdomains, which works good. The only problem is, that Wordpress creates sub-pages like this: name.tld/page/
How can I say apache that this is an under page from wordpress instead of sub-folder, because http://flamespersecond.de/home/ works but any under page from this wordpress page doesn't works?
"Not Found
The requested URL /home/neuigkeiten/ was not found on this server."
My Virtual Host file looks like this:
NameVirtualHost IP:80
<VirtualHost IP:80>
ServerAdmin EMAIL
DocumentRoot /var/www/html/flamespersecond
ServerName flamespersecond.de/
ServerAlias flamespersecond.de/
ErrorLog /home/vweb1/log/flamespersecond-error.log
CustomLog /home/vweb1/log/flamespersecond-access.log common
</VirtualHost>
I have switched the host, now is everything fine! Thanks anyway.
Related
I have created virtual hosts by going to C:\xampp\apache\conf\extra\httpd-vhosts.conf
then i wrote this:
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/basicwebsite/public"
ServerName basicwebsite.dev
</VirtualHost>
and then i went to hosts file in C:\Windows\System32\drivers\etc and wrote this:
127.0.0.1 localhost
127.0.0.1 basicwebsite.dev
then I stopped the apache server and again start it, normally it should have open the laravel application that we are making but when i open browser and typed basicwebsite.dev it showed an error in my browser it shows this
Screenshot of my page when i type the link
it says this site cant provide secure connection.
but it shouldn't have shown this , it should have shown the page.
What to do here?
Laragon provides this feature very well. It is easy to setup virtual host with it beacuse it provides Pretty URLs using
Auto Virutal Hosts
Learn more about laragon here
.dev is blocking by browser. Instead of that use .loc or something else
I developed an application with laravel and i put it in a local server and i need that other computer access it.
I think that have 2 solutions:
First: Access to laravel server (port 8000)
Second: Put the project in xampp
What is the best solution?
With the first option i can't access and with xampp it doesn't access well to routes and doesn't load the css and js files.
If i access to root folder it list the project folders and i have to go to public folder but doesn't load stylesheet files.
How can i do that?
UPDATE:
I did this steps and this not work yet.
In httpd.conf enable this line Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
Next i add a host in in hosts file:
127.0.0.1 arquivo.localhost
Next i'm going to httpd-vhosts.conf and add this:
<VirtualHost *:8888>
DocumentRoot "/Applications/MAMP/htdocs/arquivo/public"
ServerAdmin arquivo.localhost
<Directory "/Applications/MAMP/htdocs/arquivo/public">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Next i restart the apache and when i try to access to http://arquivo.localhost this give me This site can’t be reached
What i'm doing wrong?
Thank you
create virtualhost under xampp/apache/conf/extra/httpd-vhost.conf
like this
<VirtualHost *:80>
ServerAdmin webmaster#localhost.com
DocumentRoot "C:/xampp/htdocs/laravel/public"
ServerName laravel.localhost
ErrorLog "logs/laravel-error.log"
CustomLog "logs/laravel-access.log" common
</VirtualHost>
and access with http://laravel.localhost/
If its working fine on your localhost, other person can access your site using your Ip address, provided you both are on same local network.
For more you can see this reference : Accessing localhost (xampp) from another computer over LAN network - how to?
Hi can you help me about this ? because I dont know how I am supposed to solve it.
I am getting the problem if I write mysite.com/australia/ or mysite.com/australia/something ERROR 404 - PAGE NOT FOUND but if I write www.mysite.com/australia/ site is perfectly open
I am getting another problem if I write my subdomain name like this www.test.mysite.com/ it is showing Server not found but if I try test.mysite.com/ or photo.mysite.com/ then site is perfectly open
how can I solve this kind of problem?
You need to edit the apache conf file and add a server alias:
<VirtualHost *:80>
# This first-listed virtual host is also the default for *:80
ServerName www.example.com
ServerAlias example.com
DocumentRoot "/www/domain"
</VirtualHost>
See: http://httpd.apache.org/docs/2.4/vhosts/name-based.html
We have hosted multiple PHP websites in different domains in same server. Each domain have it own folder under /var/www/html. For e.g.
example1.com is pointing to /var/www/html/example1.com
example2.com is pointing to /var/www/html/example2.com
example3.com is pointing to /var/www/html/example3.com
etc..
Since Saturday, when I browse example1.com or example2.com or example3.com, it is showing same content in browser. That means every time I browse it is showing website content from /var/www/html/example3.com folder. I'm not sure how this change happened. May be one of our ex-employees changed this.
So I checked httpd.conf file in /etc/httpd/conf. Here documentroot is set correctly for all the domains. As I'm new to web administration, I'm not sure where exactly I've to correct to make all websites point to right folder.
What exactly is this problem? How will I rectify this?
Do I need to correct this in http.conf file or .htaccess file in every domain folders?
I'm struggling since yesterday. Any help is really appreciated.
Thanks in advance..
Finally I'm able to resolve the issue. I have about four websites with different domains running in this server. For couple of websites, under VirtualHost tag, DocumentRoot and ServerName were missing. After I added those values and restarted the apache server, it started working.
The incorrect entry was looking like this:
<VirtualHost *:80>
ServerAdmin demo#demo.com
ServerAlias www.example1.com
</VirtualHost>
I changed that as mentioned below:
<VirtualHost *:80>
ServerAdmin demo#demo.com
ServerName example1.com
ServerAlias www.example1.com
DocumentRoot /var/www/html/example1.com/
</VirtualHost>
Thank you all for the help.
I have 2 domain with 2 differents registar, the problem is I would like to to point them in my Dedicated server with the same IP, so I have used Virtual Hosts with this configuration :
My httpd.conf looks like this:
<VirtualHost *:80>
DocumentRoot /var/www/html/
ServerAdmin webmaster#xxxxxxxx.com
ServerName www.xxxxxxxx.com
DirectoryIndex index.php
ErrorDocument 404 "http://xxxxxxxx.com/error"
</VirtualHost>
# Virtual host Virtual Host 2
<VirtualHost *:80>
DocumentRoot /home/www/html/yyyyyyyy/
ServerAdmin webmaster#yyyyyyyy.com
ServerName www.yyyyyyyy.com
ServerAlias yyyyyyyy.com
RewriteEngine on
ErrorDocument 404 "http://yyyyyyyy.com"
</VirtualHost>
And I changed the Ip of the two domain to the server IP, this has work fine for the first website but for the second one , when entring the URL it changes automaticaly to this url :
www.xxxxxxxx.com/yyyyyyyy/
In other terms, the url is changed.
What I need to do to not permit the rewrite of the URL of the second website.
Please Help...
you need to do this in Cpanel not in httpd.conf
on the receiving(hosting) server select the addon domain and enter the domain you wish to accept and the directory it should point to
then change the IP address in your DNS A records of your redirect domains to point to your hosting server (make sure to copy the old IP address just in case you need to roll back, I recommend a screenshot)