When using Virtual Host, where should I point my browser to?  I'm trying to set up Virtual Host for Example.com. My understanding is that if all good, I have to point the browser to Example.com/phptest.php in order to access page phptest.php. But it's not working. On the other hand, if I point the browser to localhost/phptest.php, it is returning the phptest.php page.  The pertaining directory/files structure is as below.  ls -l /var/www/html/example.com/public_html total 12 -rw-r--r-- 1 ubuntu ubuntu 203 Nov 25 14:49 index.html -rw-r--r-- 1 ubuntu ubuntu  21 Nov 25 18:56 info2.php -rw-r--r-- 1 ubuntu ubuntu 641 Nov 25 13:48 phptest.php   Any help will be appreciated.
121467
This is exactly what I have set up right now:   cd /var/www mkdir -p test cd /var/www/test sudo nano index.html cd /etc/apache2/sites-available sudo nano test.conf   &lt;VirtualHost *:80&gt;     ServerName localhost223.com     DocumentRoot /var/www/test &lt;/VirtualHost&gt;    $sudo a2ensite test.conf $sudo service apache2 reload   I can access my page like this:file:///var/www/test/index.html in web browser.  &lt;html&gt;     &lt;h1&gt;          here     &lt;/h1&gt; &lt;/html&gt;   But I cannot do access: http://localhost223.com  I get the error: Could not resolve host  How to resolve this issue?
39170
how do I set up the auto redirect with apache2. I have got SSL working and want to redirect all to the SSL side. I added Redirect /  but takes me to the wrong site directory whereas https takes me to the right spot. Is that the right thing to add for the redirect? (its in VirtualHost *:80)  Current VirtualHost file:  ServerName fraffel.tech   &lt;VirtualHost *:80&gt;     ServerAdmin webmaster@localhost     DocumentRoot /var/www/fraffeltech     Redirect / https://fraffel.tech/     ErrorLog ${APACHE_LOG_DIR}/error.log     CustomLog ${APACHE_LOG_DIR}/access.log combined  &lt;/VirtualHost&gt;  &lt;VirtualHost *:443&gt;      DocumentRoot /var/www/fraffeltech      SSLEngine on      SSLCertificateFile /etc/ssl/fraffel_tech.crt      SSLCertificateKeyFile /etc/ssl/private/fraffel.tech.key      SSLCertificateChainFile /etc/ssl/fraffel_tech.ca-bundle  &lt;/VirtualHost&gt;
10344
I am totally new to Linux, servers and websites. I recently set up Apache2, Python, PHP, and MySQL for setting up a LAMP server. I am using Xubuntu 16.04 and PHP 7.0.11. I followed a guide and placed a PHP file named testing.php in it with:  &lt;?php phpinfo(); ?&gt;    It doesn't show anything on localhost/testing.php All it shows is the code itself.
124126
Hi i have recently moved my forum from Mybb to Vanilla, so the index pages such as showthread.php now do not exist. This is a big problem for SEO, what do I do to redirect this to the home page?
90133
I'd like to copy my live site so I can run it on localhost and test some modules before installing them on the livesite.  Is there a step-by-step way to do this? I have access to PHPyAdmin, so I can easily export the database. I know there's more to it than just exporting, thought.
53352
My VirtualHost config is below:  &lt;VirtualHost *:80&gt;           ServerName www.example.com           ServerAlias example.com           DocumentRoot /var/www/example/html &lt;/VirtualHost&gt;   I want to add a subdomain as such: new.example.com  And I want to add a wildcard to catch all other subdomains (*.example.com) and route them to www.example.com.  How should I add this subdomain? Will it involve an A record?  For the wildcard, if I change my ServerAlias to...  ServerAlias example.com *.example.com  ... then will it interfere with my subdomain (new.example.com)?  EDIT: I have several domains on a single host (via virtual hosts). This is in the same folder as 000-default.conf, but it's named example.conf. (I've actually deleted 000-default.conf, and used conf files named after the domains they point to.)
33810
I recently installed Ubuntu 14.04, then I installed lamp-server and placed my webpages in /var/www directory, but when I opened localhost in the browser there was nothing. I think that happened because Zend updated Apache.  Whatever the reason may be, I want to know where to keep my php files so that I can access them from my browser.
81636
I have just set up a wi-fi network at home. I have all my files on my desktop computer (192.168.1.56) and want to access localhost over there from another computer (192.168.1.2).  On my desktop I can access localhost through the normal . Apache is running on port 80 as usual.  Exactly what do I have to do to achieve this? There is documentation on the net but they either don't work or are too fragment and confusing to understand.  I think I have to make changes to my apache's httpd.conf file and the hosts file. Any ideas as to what changes to make?
59079
Here is what I have got:   CentOS 5.4 (32-bit)    installed Apache httpd (Server version: Apache/2.2.11 (Unix)) mod_rewrite already presents   Question: how to redirect simple  to  not using VirtualHost defines?  PS: tried to find in later answers on SF, but doesn't find nice solution.  Thanks.
35370
I have a PHP application (Wordpress) in the root folder of my site, and all requests to the site run through it happily.   However, I have a subfolder, _links, which I would like to use to execute another, different php script.  Eg, if a user goes to site.com/_links/221312, then the index.php script from /_links takes over.  I formerly used a .htaccess file to achieve this, but since moving to nginx I can't make it work.   Here is the old .htaccess file.  RewriteEngine On RewriteRule    ^([0-9]+)/?$    index.php?linkid=$1    [NC,L]   Obviously, I'm passing the last bit of the URL to the script as a parameter.  Here is my nginx config. Requests to eg site.com/_links/23423 are picked up by if (!-e $request_filename) and rewritten to /index.php?q=/_links/23423 instead of being picked up by the location block.   server {         listen  127.0.0.1:8080;         server_name site.com www.site.com m.site.com;          root /var/www/site;         location ^~ /_links/ {                 add_header location 1;                 root /var/www/site/_links;                 rewrite "^([0-9]+)/?$" /index.php?linkid=$1 break;                 location ~ \.php$ {                         try_files $uri =404;                         fastcgi_pass unix:/var/run/php5-fpm.sock;                         fastcgi_index index.php;                         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;                         include fastcgi_params;                  }          }         index index.php index.html;         if (!-e $request_filename)             {                 rewrite ^(.+)$ /index.php?q=$1 last;             }         location / {                 try_files $uri $uri/ =404;         }          # pass the PHP scripts to FastCGI server listening on the php-fpm socket         location ~ \.php$ {                 try_files $uri =404;                 fastcgi_pass unix:/var/run/php5-fpm.sock;                 fastcgi_index index.php;                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;                 include fastcgi_params;          }         access_log /var/log/nginx/site.com.access.log;         error_log /var/log/nginx/site.com.error.log notice; }   I'm really confused. What's going on here?
233
Hi all im a noob on Ubuntu/Linux World,  So i need some that give a full tutorial to How to install  from apachefriends.org correctly on Ubuntu 11.10 + all beyond Ubuntu for 32 bit and also 64 bit Desktop Version.. and also i need this:   Make a Folder on Your Home Folder and Linked to htdocs from Apache Web Server Make a GUI interface for Xmapp Start Xampp when Ubuntu Boot Up or Start Ubuntu   (Note: i ask it for both X86 and X64 so people in the further can see the tutorials)    New Data:  What i did was i download from  for now and i also what to say that I'm currently running Ubuntu 11.10 X64 bit for Dell Studio 1558 processor intel i3  i will let you know guys which solution was the best, and it is for a Desktop Version of Ubuntu 11.10 (Laptop 15 inch screen ^_^ ) not Server Ubuntu
8474
I'm confused with how symbolic links work. I hope someone can guide me in the right direction.  I want to put a demo online from our software, which normally only runs locally on a Mac Mini. So I put all the files in the var/www from my Ubuntu 12.04 server installation.  There are a lot of hardcoded links in the software which point to /Applications/XAMPP/xamppfiles/htdocs/narrowcasting  Of course, I could change all these code on my html/php files in /var/www, but that would be quite annoying. I hope I can fix this by creating a symbolic link. For example, I have a directory called thumb in /var/www/thumb. The PHP code is trying to put an image in /Applications/XAMPP/xamppfiles/htdocs/narrowcasting/thumb.   Can anyone give me a tip how to achieve this with a symbolic link?
96307
My IP xxx.xxx.xxx.xx is pointing to example.com at GoDaddy but I just noticed that when I type the IP in browser, it doesn't redirect to the website, how can do this? I am sure this will happen through httpd.conf but unsure about what I need to add.
56581
This may be a bit of a noobish question, but I was taking a look at /etc/hosts on my new Xubuntu install and saw this:  127.0.0.1 localhost 127.0.1.1 myhostname   On most 'nixes I've used, the second line is omitted, and if I want to add my hostname to the hosts file, I'd just do this:  127.0.0.1 localhost myhostname   Is there a difference between these two files in any practical sense?
69356
Maybe I'm making this way more complicated than I need to, but I want to serve my Drupal site that I've installed at example.com/drupal from example.com.  This particular site is an add-on site on my shared host, so the actual file structure is public_html/example.com/drupal.  What do I need to modify: .htaccess or add a redirect in cPanel?  I can't imagine I'm doing anything radical here, but there's no clear-cut answer in all my searching.
46436
I am writing a small website, but I do NOT want to figure out how to install and configure complete LAMP stack to test the website from my ~/home directory. That will be completely disruptive and unnecessary.  All I want is to have a directory, e.g. ~/home/Documents/Website and run a small web server from that folder as the website's "home" folder.  I know  can do something similar, but it only seems to work with Ruby/Jekyll-based sites that it builds and configures.  Isn't there some small web server program that I can easily install and then just run very simply?  For instance, if I just needed to run something like e.g. simple-server serve ~/home/Documents/Website from a command line and then navigate to e.g. localhost:4000 or whatever to test the site, that would be perfect.  If this is already possible in Ubuntu and I just don't know how, please let me know.
98531
I have just installed Ubuntu Server 10.04 with a LAMP setup.  I want to host a website there but I'm not sure which is the best way to get/edit my files on the server.  Googling provides many options but I'm not sure which is best?  Unless there's a better option, I'd like to be create the pages on another PC (Windows or Linux) and use SFTP to sync the changes to the server - but do I do this to a symlinked folder in ~/ or by changing rights on the /var/www/ folder?