How to access html file using local host [closed] - apache

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
Please I need help with accessing my html/php file with localhost on my browser,i turn my xampp on and tried to access my html/php file,but it is still not working
That's what I keep getting everytime

The path component of the URL to your file starts at the directory specified in the DocumentRoot configuration option for your Apache HTTPD server. This probably defaults to the htdocs directory.
It doesn't start at the root of your filesystem. Web servers do not, by default, expose every file on your hard disk to the network (which would be a scary default for security reasons).

Normally you don't have to enter xampp/htdocs in the link. localhost is reffering to your xampp htdocs folder "automatically". Try localhost/phpinvscode
If you put your index.html file in the htdocs folder directly you would only need to enter localhost in the browser.

Related

Special configuration of the vhost [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I've got some headache trying to configure that for some days so I hope someone can help me.
I've got few sites, each one related to an FTP account. I would like to make them accessible through my man website by the url http://www.mainsite.com/site1. At this point an Alias should do the work.
However I would like to add some features such as specify the log file related to the site1 which would be in the web directory of the FTP account site1. Later, I would like to put them in /var/log and have a script to sync the log file located in the web directory with the one in /var/log so that even if a user delete the log file in the web directory, the original one is still here.
To go back to the main problem, I don't know how to do that, I tried to configure a whole vhost for the site1 but then, as the ServerName would be the same as the main site, the main site would no longer be accessible.
Any suggestions ?
You could try the ancient ServerPath directive, which will cause /site1 to be mapped to one vhost and /site2 to be mapped to another, despite having matching servername and local interface:port.

How can I change host Name for Apache tomcat server? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I installed Apache Tomcat 6.0,I tested with simple Application it's working fine.but every time I calling my app with localhost:8080 in the browser.
I want to change host name(localhost) to something like subbu.for this I tried in the following way.
I open command prompt and entered drivers and after selected etc folder, open host file .in this file I changed subbu instead of localhost.After did this I restarted my system and started apache server and entered in my browser like subbu:8080.it's not working.
I hope,you understand what I faced problem.
How can I resolve this.
In /etc/hosts change the line
127.0.0.1 localhost
to be
127.0.0.1 localhost subbu

Removal of the /var/www/icons alias from Apache config [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have a directory called /var/www/icons on my web server, which is also referenced as an alias in my Apache config as seen below:
Alias /icons/ "/var/www/icons/"
The directory contains a number of small PNGs and GIFs, which AFAIK are unused, along with a README file.
Am I safe to remove this alias from my Apache config by commenting it out? If not, what area of my application is the removal of this likely to effect?
There is very little documentation available on this directory and I must admit i've never came across it up until now.
Most icons are used for displaying file types in directory listings. If you do not use such listings, you can safely remove alias + files. I did so and do not miss them.
It is for sure safe to remove it. Other conf files could reference /icons (e. g. the autoindex module) but apart from some not found errors nothing nasty should happen.
My advice: scan the access.log files to see if urls rooted at /icons are accessed. Delete the alias and monitor the error.log file for 404 errors.

Access new web site via browser with IP address? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Ive set up a new site with WHM but havent got the DNS set up yet. I want to be able to access the site via a browser so I can set up a CMS. Usually, I can just do this by entering the IP address into the browser, but this time I just get a page saying that Apache is working on the server.
Does anyone know a way round this?
Thanks!
The problem is that the request your browser is sending doesn't include the correct Host: in the HTTP header, so the web server replies with the a default catch-all page.
You can either
setup a private (local) authoritative DNS server with a yoursite.com zone, and set your system's DNS to point to this DNS server, or
temporarily trick the DNS resolution in your local system by registering whatever.yoursite.com with it's corresponding IP address in /etc/hosts file (in unix-like systems). There's an equivalent file in MS Windows systems, look for a file named hosts in C:\Windows\system32\drivers\etc.
I'd try with the latter first, as it's just a matter of adding a single line to a text file:
203.0.113.22 whatever.yoursite.com
You may need to restart your browser.

How do I change default directory and index file for Apache (installed via XAMPP) [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
How do I change default Directory and index File for Apache (installed via XAMPP) so instead of looking for htdocs and index, it looks for myPath and myFile, respectively?
The research link you pasted has the first part of the answer to your question, changing the path you want serve but the second part of your question, making it serve "myFile" as the Index is an additional step. See:
http://httpd.apache.org/docs/2.0/mod/mod_dir.html#directoryindex
So you would add this line inside the relevant tags or even loose in the main httpd.conf file (see the Context section of the above link for valid places to use this directive):
DirectoryIndex myFile.ext
Hope this helps.
Edit the httpd.conf file - the DocumentRoot directory can be updated to whichever directory you would like (and that the process has permissions to). See:
http://httpd.apache.org/docs/2.0/mod/core.html#documentroot
DocumentRoot /usr/web