Am new to Mamp Pro though I've been using plain Mamp for a while. Using MacBookPro running Yosemite.
Mamp's default localhost server is working fine and in a browser I can open subfolders living in htdocs with no problem and they behave like sites.
But I set up a virtual host in the Mamp Pro interface, e.g., clientname. The folder 'clientname' lives in the Mamp htdocs folder. Have restarted Mamp. When I try to view the site (clicking on the arrow in the Mamp Pro interface) in a browser (Firefox) it wants to download a file rather than opening the home page. Safari simply shows a blank page.
What am I doing wrong?
Solved it, was a problem of file suffix. With the site set up in this way, on a virtual Mamp Pro server, browsers wouldn't open index.html, it had to be index.php
I don't understand why this should be especially as that page has only static content and doesn't need to connect with the database and doesn't contain a php include file or any php code at all.
If anyone knows why the page has to be .php I'd be interested to understand the issue.
Related
How can I open my local XAMPP site and iPad?
I tried to open it like this:
http://192.168.3.132
But it keeps loading so I guess it does not work.
The IP is correct, I got it using ipconfig (Windows).
I'm trying to debug my application but any URLs which contain localhost (I've tried IIS Express, Local IIS, a simple Node server, and a Python development server) are redirected to the IIS welcome screen.
Examples:
localhost:xxxx/MyController
localhost:xxxx/SomeFolder/SomeFile.html
localhost/MyApp/MyController
localhost/MyApp/SomeFolder/SomeFile.html
The URL changes from the full url to my external IP address (i.e., URL changes from localhost:xxxx/MyController to simply XX.XX.XX.XX)
I just tried launching with a brand new ASP.NET "Empty Web Site," just loading the index.html file, and same situation.
There are no entries in my hosts file and it appears that this is only happening in Chrome. Any ideas?
This works in php, so it may help you with ASP:
Run Notepad as administrator
Open C:\Windows\System32\drivers\etc\hosts file
add the following line to hosts file
127.0.0.1:123 yourserver.com
Save
Run command prompt using CMD in run or type it in start menu
Type this command and hit enter
ipconfig /flushdns
Close
go to yourserver.com
I hope this help you. Again, this works fine with PHP.
It sounds like your DNS is resolving the localhost hostname. If you're using your ISP's DNS, this may happen. You could change the DNS to Google's Public DNS. By pointing the DNS server to IP's 8.8.8.8 and 8.8.4.4. See the link for details on how to configure your computer.
I recently installed apache and php on a ubuntu vps and i'd like to be able to make web requests from an iPhone app to php files on the server namely files inside the www folder ex:'var/www/myfolder/echo.php' by ways of a web request from the app to the URL 'http://ipaddress/myfolder/echo.php' or whatever the correct url is. I do not know the URL i need to type in to access the echo.php file. can anybody shed some light on this confusing situation I'm in?
ps. this is my first time working with servers
You need to check what your DocumentRoot is set to in your Apache configuration.
So if /var/www is the DocumentRoot, which is the default on Ubuntu, then your URL will be http://machinename/myfolder/echo.php, which is what you have.
Before doing any coding on the iPhone, test the .php file in a web browser.
Any errors during development and testing, then check the Apache error log (/var/log/apache/error.log).
consult https://stackoverflow.com/a/23175981/2038460
solved my problem! i just had to specify the document root to actually be the folder i was working on, i though it'd be enough just having it at/var/www but apparently not, had to be /var/www/folder
I want to view my project on an iPad over a local network. I have tried changing the IP address at the start from 127.0.0.01 to my IP address found using cmd and ipconfig but the files still won't load. Is this possible and how to please?
I believe that you need to run a server using a software like WAMP/MAMP/LAMP/XAMP or AMPPS. Then you may put your website in the "compiling" folder (usually it is something like htdocs or www). And finally you can use the http://localhost/ address.
I'm working on a local Rails website, and I'd like to access to it from my visrtualbox machine running winXP
From my Ubuntu machine, I use my browser to open http://www.myapp.local:3000
How can I access it from Virtualbox?
Thanks a bunch!
On your xp machine, open up your hosts file at C:\Windows\System32\drivers\etc\hosts in a local text editor like notepad or whatever is on there.
Then add a line like this:
10.70.30.31 www.myapp.local
Where 10.70.30.31 is the IP address of your Ubuntu machine.
Save the hosts file. Then restart whatever browser you're using on the XP box. Make sure you close all of the browser windows you have open as well because your browser will cache your hosts file until you properly restart it.
Once you've opened a new browser window you should be able to access your rails site from the same address you use on your Ubuntu machine.
http://www.myapp.local:3000