How do I make the Apache Server point to the /var/www/html directory - apache

In a new RHEL 7.5 server, I have created a var directory and within that the /www/html directory in which my website resides. When I try to access the website, I get the Apache Server Test page and mentions that the Apache server is running and I need to point to the /var/www/html directory.
How do I point the Apache Server to the /var/www/html directory?

You need to configure the available-sites and enabled-sites and remember to restart apache after changes in the config files.
Have a look at this guide:
https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts#step-four-%E2%80%94-create-new-virtual-host-files

Related

http://localhost is getting forwarded

I am using Xampp and in my htdocs directoy I have a folder called 'task4u'. If I go to http://localhost, I'll get forwarded to the page of 'task4u' (which is a Symfony 4 application).
In htdocs I have now created a new folder for a new website but I still get forwarded to the directory 'task4u'.
I have checked the windows file 'hosts' but there is nothing related to this issue.
Where could that forwarding be set? Is that because of Symfony itself maybe?
Windows host file contains only a redirect to 127.0.0.1 (loopback address) for "localhost" (or you can configure more redirects to 127.0.0.1).
You have to give a look to httpd.conf Apache file; it should be under this path for a XAMPP installation: C:\XAMPP\apache\conf\httpd.conf. Open httpd.conf with a text editor and change it with your new directory path under DocumentRoot C:/your/path and < Directory C:/your/path/>
Remember to restart Apache server by XAMPP interface.

WAMP localhost and phpmyadmin setup

I have inherited a WAMP setup, but needed my http://localhost to point to a different directory "C:/Users/[user.name]/htdocs" due to many dependencies.
I made the following changes in httpd.conf
DocumentRoot "C:/Users/[user.name]/htdocs"
<Directory "C:/Users/[user.name]/htdocs">
where the original path was "c:/wamp/www/"
Now the WAMP default path for phpMyAdmin http://localhost/phpMyAdmin is not working anymore.
Is it possible to fix that via either C:\wamp\alias\phpmyadmin.conf or httpd-vhosts.conf somehow?
Can I suggest a better solution to your requirement to have a site running that does not live in the WAMPServer default location i.e. \wamp\www or \wamp\www\somefolder
If you revert all your httpd.conf changes to the out of the box state and then create a Virtual Host to run the site you have located in your \user.... folder.
Virtual Hosts are a standard Apache feature that allows you to run may sites from a single instance of Apache, a bit like a shared hosting package setup.
You would then have the benefits of the WAMPServer homepage running on localhost and all the other alias's tools as well.
You can then run your site using a nice url for example sitename.dev and the virtual host definition also allows you to setup any site specific requirements without effecting any other site you may want to run.
There is a HowTo Setup Virtual Hosts here on SO

Root directory of web server

What is the root directory of Apache Web Server?
I am using Windows XP. My Apache server is installed at:
C:\Program Files\Apache Software Foundation\
I want to host a server and its manual says:
move all files and subdirectories from that directory to the root directory of the web server
It depends on how you've configured the server. The 'root directory' is actually called the document root, which is the directory from which the Apache HTTP server would serve files from. It can be changed using the DocumentRoot directive, which you should be able to find inside the configuration file(s) (e.g. /etc/apache2/apache2.conf).
From the documentation:
For example, if DocumentRoot were set to /var/www/html then a request for http://www.example.com/fish/guppies.html would result in the file /var/www/html/fish/guppies.html being served to the requesting client.

Hosting personal pages over a Redmine installation

I currently installed redmine on my server, and configured apache2 to run it in a virtualhost over mydomain.com
Thing is I also want to host some extra pages, at mydomain.com/personal, but since redmine is running the page is never found. How can I override this configuration to run both redmine and some personal pages?
You need the Alias directive to just create a virtual directory, which maps /public with some other real directory on the filesystem.

Virtual Host using Apache

We have development team of 10 people working on Linux platform our application is hosted on Apache server
Now what i want if every developer is having own codebase in his directory
he can have his own httpd conf file which uses his code base and his port on that server
and whenever he changes the code base he needs run only his apache process
and there is no need to start , restart the apache server as other people should not get disturbed
so can we do this listening same server on different ports with different DocumentRoot and no need to start or restart the whole apache server only individual process of apache need to be started if any changes are done in the local conf file of that user
You need not get into the complexity of managing virtual hosts.
You can create alias for each developer which will point to his directory.
http://httpd.apache.org/docs/1.3/mod/mod_alias.html#alias
Eg :
servername.com/dev1/
in httpd conf point dev1 to developer's working folder.
Developer can update code see the result at the above url without restarting server.