Need to change the apache default home page - apache

I am new to apache.I installed apache in my windows, I am having my own html page with css.I want to set this page as my default apache home page and instead of typing http://localhost:8080, i have to type http://vignesh to view my home page.
How to do this..Guide me

I think your question is split into 2 things: The ability to use http://vignesh as opposed to http://localhost:8080, and the option to change the default home page.
In order to get the url that you want working, you need to modify a file in windows (assuming you're on windows 7) do the following:
Launch notepad (or any other text editor) with administrative privileges
Open the hosts file located at: C:\Windows\System32\drivers\etc
Add the following entry to it: 127.0.0.1 vignesh
In order to change the default page you need to change the apache configuration.
Open httpd.conf in your favorite text editor
Locate the property called DirectoryIndex. Change it to the page that you want.
I hope that was helpful.

When you type an address in a browser, the browser relies on the operating system to resolve it. Only once it has been resolved, a request is sent to the actual server (in this case, your apache installation).
Because of this, you can't alter how the "server" part is resolved through apache itself: it is your Windows system which handles that and, if appropriate (this is, if it resolves to localhost at the port where your apache is listening), forwards it to apache.
So, you need to alter how Windows, rather than apache, resolves that address. Fortunately, for your situation, it's relatively easy to tweak, if you know what to look for (and I am telling you here, so you know ;) ):
Open the file %SystemRoot%\system32\drivers\etc\hosts on a plain text editor, such as notepad (%SystemRoot% is window's base installation path, such as C:\Windows or C:\WinNT), and add a line like this at the end:
127.0.0.1 vignesh

Related

How can I run an index.html file on my localhost server?

I purchased a fancy little "visual menu maker" over at envato (Code Canyon) from here: https://codecanyon.net/item/z-menu-maker-drop-down-and-mega-menu/9240528
I was using their sample app where you can test out the tool and I was able to create a nice little menu for my site. But you have to purchase a license to export the code.
I purchased the license and the first "Getting Started" requirement is to "Start your Web Server and open the index.html file. This is where I'm lost. BTW... for reference, you can scroll to the bottom of that documentation page to see all the files that were included in the download.
When I try to open that "index.html" file in my browser, it doesn't load.
I followed some instructions to get my native Mac Apache server running, and everything seems to be working, with my localhost, but I don't know how to open this file through my Apache Web Server.
Any help would be so appreciated!!
I am assuming you have your Apache installed on your Mac under /etc/apache2 folder
If you want to serve your html files and related components, you need to tell apache from where to find your files
So , you need to configure apache so that it can server your files.
first you need to open an terminal from lunch menu then go to the apache2 installation directory
cd /etc/apache2
Then you need to open httpd.conf file and make necessary changes,
sudo nano /etc/apache2/httpd.conf
You will see "DocumentRoot" line/. Change it with your directory where you put your files.
Change also Directory path with yours. (It should be in same config file such as
with
<Document "some_path">
Then you should restart apache server with command
sudo apachectl restart
Now you can try to access your file . you can also check http://localhost to validate
You need to put the files somewhere within the DocumentRoot of your Apache web server, and then you should be able to visit them with http://localhost/ (assuming the index.html file is in the root of the DocumentRoot).
I'm not familiar with the default setting of DocumentRoot on the Mac port of Apache, but you should be able to find that quite easily in the configuration. On Linux that would commonly be found somewhere under /etc/apache2 or /etc/httpd.
There may be further configuration needed if the files expect some sort of server-side module to be activated (e.g. PHP), but it sounds like they are just plain HTML.
Some good answers were given but I think this particular app needed a few extra steps in order to work properly.
The developer got back to me and told me I'd need to install a MAMP solution in order to run the app.
So I installed that and then took the unzipped folder and all its contents in this folder /MAMP/htdocs/
Then when I visit http://localhost:8888/ZMenuMaker/ the app runs without a hitch!

How to set properly QPKG_WEBUI variable in QNAP

I am trying to developing an App for QNAP. I am really noob about QNAP, so please help me!
I succeeded in creating a qpkg package and installing it correctly, and it works. But the problem arises when I want to give my app a web interface.
I have just a index.html file that just has an helloworld text inside.
I create the environment with the QDK and I have the /share/XXX_DATA/.qpkg/QDK/MyApp folder
Now, a part of the other files, I create
/share/XXX_DATA/.qpkg/QDK/MyApp/Web
and put there my index.html with my HelloWorld message.
Ok now, I modify the /share/XXX_DATA/.qpkg/QDK/MyApp/qpkg.cfg file and set the variable
QPKG_WEBUI="/MyApp/Web"
From the documentation, for example https://edhongcy.gitbooks.io/qdk-qpkg-development-kit/content/qpkg-configuration-file.html , I can see
QPKG_WEBUI
Relative path to installed application's web interface (the
specified path is relative the configured location of web server data;
usually /share/Web or /share/Qweb.) The specified path must start with
a '/'. The displayed link can only be accessed when the QPKG is
enabled. A default value of '/' is set automatically at installation
if QPKG_WEB_PORT has been given a value and QPKG_WEBUI is empty.
Then I also create a link in /share/XXX_DATA/Web folder to my web folder.
(the /share/Web is just a link to /share/XXX_DATA/Web)
That is:
ln -s /share/XXX_DATA/.qpkg/QDK/MyApp/shared/Web /share/XXX_DATA/Web/MyApp/Web
Well, what happens that now, I can open a Window in my QNAP when I click on "open" in my app but it is completely blank. I tried a lot of different variants but my window is allways blank.
Must I modify something more a part from the qpkg.cfg file?
Do you have some documentation with sample codes?
Is QPKG_WEBUI the correct variable to modify?
Thanks very much to everyone
After a carefully study of the problem, and after trying other applications with the same problem, I found the conclusion that the problem was not the QPKG_WEBUI variable.
The problem was that my QNAP web interface (I do not know if it is a general thing for every QNAP or only in my case) has as default port 8080, but the WEBUI have as default port 80.
Then it seems that the web browser blocks the WEBUI in the iframe inside the QNAP interface in order to follow the Same Origin Policy. When opened in a new window, the WEBUI works correctly.
Setting the QPKG_USE_PROXY=1 variable let the iframe work too.

Intellij idea opens static pages in browser with different url formats

Intellij idea has a nice "open in browser feature" that I use quite often for my static html files. Any html file can be opened in browser in two ways: 1. Idea has an internal web server that serves static content at http://localhost:63342/<relative path to content> . 2. Via file:///<absolute path> url.
After a recent update (14.0.2) the browser started to open pages as file:///<absolute path> although the internal web server is still present and all I need to do is edit the url. Very annoying. I searched a lot but still can't figure out how can I influence this behaviour so all my static pages would open in browser as http://localhost:63342/<relative path to content>
Specify the server connection settings:
In the Host text box, type localhost.
Use the Port spin box to specify the number of the port where the built-in web server runs. The port number should be set to 1024 or higher. By default this port is set to the default IntelliJ IDEA port through which IntelliJ IDEA accepts connections from services (63342).
Specify the folder that will be considered server document root. The folders that are under this document root in the project tree will be submitted to the PHP interpreter. The server document root folder will be accessed through HTTP at the above specified host:port.
In the Document root text box, specify the path to the relevant folder. This can be the project root or any other folder under it.
References
Idea Docs: Built-in Web Server

Accessing Apache Server from the internet

I have installed Apache on Xubuntu and I am have a problem accessing it from the internet.
If I access it via localhost I can reach the home page plus pages in the subdirectory. How if I access it from the internet I can get the home page but nothing else. When I type in the subdirectory and page, no links at this point, It either never leaves the home page or gets rerouted back to it.
I have no .htaccess files in place, I have tried adding an alias and entries in the conf file and I have checked ownership and permissions. I have gone as far as wiping the machine and starting with the same results.
I feel like it is going to be a case of missing something simple but I cannot think of what. The log files have indicated that an IP tried to access the subdirectory but shows no error in doing so. When typed into the URL the /Directory/Index.html shows in the address bar but it displays the home page.
Can anyone point me in the right direction?
Thanks,
Most likely the issue is contained either in your apache.conf file or your firewall. I would have a good look at your apache.conf to see if there is anything restricting access to your sub-directories.
if you want to use default http port (80), so long story short www.abc.com without explicit port number, you must allow this on your server because 80 is privileged on most system, this could be a problem

Need to access remote files from Apache server

I am new to Apache.
I am running apache tomcat in windows and using JSP as the server side language.
I have a page containing links to the files (different machine) as below:
TheButterflyEffec(2004).avi
Superbad.avi
Why OnClick, saveAs is not working?
It is working if i save the page locally.
Do I need to configure anything in server.xml?
If the files are loaded on the machine running the apache then you need to look of two thinghs...
Put the files in a directory inside the apache root directory
In the <a href specify the file location with the ip address of it
(i.e. if your apache is on a machine with IP 192.XXX.XXX.XX then give the a href as follows
<
a
href='http://192.XXX.XXX.XX/folderWherefilesare/filename'>
filename < / a>
It's not working because the browser look for those files on the local visitor machine, not on the server.
You have to build "proxy" code with server side language like PHP that will get file name as parameter, e.g. Download.php?file=TheButterflyEffec(2004).avi then read the file from the server disk and send the file contents to the browser.
If you're using PHP indeed, here is an article describing what you can do:
http://www.boutell.com/newfaq/creating/forcedownload.html
Otherwise let us know what server side language you can use and retag your question according to this.