I have been running a co-located Linux box with several httpd vhosts. A few years ago I recovered an archived web site and added it to an existing domain as a directory under htdocs as a sub-site. It is an older site that uses frames but works correctly underneath the main domain.
The old website has nostalgic value to certain hobbyists and a couple of weeks ago I decided to acquire another domain so that this sub-site could be accessed directly. However, the frames do not get set up correctly and the pages do not display like they should - stuff is obviously missing.
I have tried several things but no avail. Currently both domains point to the same location.
Here is my Apache config for the main site (http://www.vintagewargamingfigures.info/):
<VirtualHost 64.182.125.197:80>
ServerName www.vintagewargamingfigures.info
ServerAlias vintagewargamingfigures.info
DocumentRoot /local/web_sites/vintage/htdocs
</VirtualHost>
Here is the config for the sub-site when it fails (http://www.vintage20mil.com/):
<VirtualHost 64.182.125.197:80>
ServerName www.vintage20mil.com
ServerAlias vintage20mil.com
DocumentRoot /local/web_sites/vintage/htdocs/rblack
</VirtualHost>
The document root shows the site as being in a directory (rblack) under the main site.
Google Chrome has fooled me a couple of times and it looks like it was working but sometime later it will not work. So, I also use MS Edge to test it.
I have tried several things, including running some symbolic links directly to the rblack directory but haven't found the cure yet.
What am I missing? I suspect it is something simple but it is eluding me.
Any help appreciated.
.......CG
Related
I'm a newbie in deploying apps using Apache. Not so long ago I've deployed vue.js using very simple tutorial configuration and then I tried to deploy strapi admin panel on the same VDS using same IP. So I am faced with a couple of troubles:
I don't know how to modify my configuration to deploy admin panel with my site correctly.
here is my config:
<VirtualHost 188.***.**.***:80>
ServerName my-site.com
ServerAlias www.my-site.com
ServerAdmin someEmail#example.com
DocumentRoot /var/www/mySite/public_html
<Directory /var/www/mySite/public_html>
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/www/mySite/error.log
CustomLog /var/www/mySite/access.log combined
</VirtualHost>
I've rented VDS on hosting service and they gave to me technical hostname which is connected with my server IP and this makes me puzzled, because I have to configure Server name and Server Alias in my site conf. Is these parameters will be visible in internet or in domain name system?
maybe I'm asking stupid questions but after a week of deep-sitting in documentation I didn't find clear answer.
Well, i found an answer. If you faced with the same problem. To deploy another site on your apache server you should add another Virtual host directive in your conf file (example in question), then when you try to set Server name or Server Alias - you should write your website domain. Just look at apache as phone list for all websites of your server. Domain names is always connected with some ip address so when you write down web site url DNS looking for ip address wich is connected with domain you wrote, and after that apache - wich works on server try to compare your domain with domain in confs - if it find equals it will throw back to you webpage if not it throw to you first deployed site (first Virtual Host to say simple).
Lets come back to the main topic. if you want to have two sites on your VDS - you have to have two domains in that case it is very easy to deploy two sites on the one server with one ip. i hope my answer will be useful for newbies. And i really sorry for my english.
I've been having a lot of trouble with setting up an Alias for my Virtualhost.
I have 2 different codebases that need to be on the same server, I have the admin app as well as the client app.
My virtual host is as follows :
<VirtualHost *:80>
DocumentRoot "E:/xampp/htdocs/site/client"
ServerName local.site.com
Alias /admin/ E:/xampp/htdocs/site/admin/
</VirtualHost>
My folder structure is as follows :
site
- admin
- client
Everything works fine as far as the client goes, I can hit everything under the subdirectory.
The issue arises when I try to hit local.site.com/admin. It redirects the URL to local.site.com/admin/index.php/index.php... and so on (there is like 10 of them).
I also can not hit the index.html in the admin folder directly.
The result I expect is for all traffic to /admin to be directed to the admin folder.
I can not for the life of me figure out why the redirect is happening.
I do not have any .htaccess files in the folders for what its worth.
Any help would be appreciated.
Thanks
I followed instructions and added in my httpd-vhost.conf file
<VirtualHost *:80>
ServerName project-laravel-learn.my
DocumentRoot "/srv/http/project-laravel-learn.my/public/"
</VirtualHost>
also added like for other local projects, map in hosts file so that
project-laravel-learn.my goes resolves to 127.0.0.1
http (web user), has all permissions to write and read on that public
folder,
also app/storage is rw- for http,
however, when I visit project-laravel-learn.my I get page saying
Whoops, looks like something went wrong!
What might be the problem? Also how I can get more detailed error message as
this one above isn't that much useful.
Just to add, app was working fine before I moved it to /srv/http/, while developing and using php artisan serve command.
EDIT: Ok it works, I forgot to start my local web server instance, however now routing does not work, I get only homepage, but clicking on any link gives 404 object not found error!?
How to fix that?
Found solution here..
http://www.epigroove.com/blog/laravel-routes-not-working-make-sure-htaccess-is-working
I will leave it for a future reference.
I have been trying this for hours and am getting pretty frustrated. I am trying to use a ReadyNAS Pro as a webserver. It uses Apache for its web interface. I would like to use that interface when I address the device via IP address, but I also have my domain name pointing to it. When I use my domain name I want it to display my website (with wildcards for the website's pages). I have tried using mod-rewrite without much success. It seems to break the ReadyNAS web interface. I have tried adding a named virtual host, but I don't have much experience with that and I don't know what I should use as a default virtual host to address my machine by IP. I have tried moving the ReadyNAS web interface to a sub-folder of the Apache Root, but that seems to break the web interface also.
It should be noted, that while I could create a subdomain for the web interface, I would rather address it by my machine's local IP only so it isn't visible to the outside world. While there are some simple tutorials of setting up a website on the ReadyNAS they use the ReadyNAS share system that appends a folder name to your url i.e. domain.com/www/. This is just no good.
Long story short, I want to host my website using my domain on my ReadyNAS (no sub-folders). I want to continue using the ReadyNAS web interface, but only from my local network. I do NOT want to run a second web server. I do NOT want to wipe the original OS (proprietary hardware/drivers are used for intelligent power management)
For reference it is a ReadyNAS Ultra 4+ with ReadyNAS default OS (Debian Etch).
P.S. Don't tell me this isn't what a NAS is for, I am aware and I don't care nor want to hear you cry about it.
If I did understand correctly you would like to access your own site with address like mydomain.home not mydomain.home/www I have achieved this with following config by using ReadyNas Duo
First modify Virtual.conf file from
<VirtualHost _default_:80>
to
NameVirtualHost *:80
<VirtualHost *:80>
Now you can add new virtual host config file under the addons directory ie. mydomain.conf
<VirtualHost *:80>
ServerName mydomain.home
DocumentRoot /var/www/mydomain.home
<Directory /var/www/mydomain.home>
Options Indexed
Order allow,deny
Allow from all
</Directory>
SSLEngine off
</VirtualHost>
Here is link for the original post that I did follow https://liewdaryl.wordpress.com/page/2/
I did add NameVirtualHost definition so apache would not warn about overlapping virtualhost definitions
I'm developing a few sites with Wordpress on a local server. I have my MAMP (2.0.1) running with the default port numbers for Apache and MySQL on Lion (10.7.2). It's been working quite well until I recently encountered a perplexing problem.
One site in particular has undergone a few internal domain/vhost changes (this is how I came to the conclusion of using the default port numbers re:my own Wordpress development) which are referenced in my /etc/hosts file and also in my MAMP apache httpd.conf VirtualHosts section. Now when I visit this particular development domain defined in the hosts and httpd.conf vhost, it gives me a browser error stating that it couldn't establish a connection to dev.example.com:8888 (the Wordpress index.php and htaccess files are in the folder index). I'm a bit annoyed and confused as I've changed the MAMP ports to the default, yet this references the 8888 default MAMP apache port only on the domain index and doesn't want to sway its course even if I visit dev.example.com:80. I can access files and folders within the domain by specifically typing them in, but visiting the domain index as it is gives me this error with the default port number. I have no idea why that is and haven't been able to find a solution via the internet.
Some search results have mentioned incorrect line formats in the hosts and httpd.conf files, but mine are all Unix LF based so that solution hasn't made a difference. I've removed Wordpress from the domain's folder structure and tried again but it still gives me the same error. On another domain I'm using with Wordpress it works fine; the folders are set up exactly the same way, as are the entries in the hosts and the httpd.conf files. I get no apache errors when I visit the particular erroring domain as well. I'm just a bit stumped on the whole thing.
Hosts entry:
127.0.0.1 dev.example.com
Vhost entry:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName dev.example.com
DocumentRoot "/Sites/example.com"
</VirtualHost>
Wordpress config:
sql.wp_options.siteurl = http://dev.example.com/wp
sql.wp_options.home = http://dev.example.com/