access var/www folder on ubuntu 14.04 vps - ios

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

Related

www.sample.com automatically redirected to sample.com

I'm running two sites on Linode. Testing server.
I have one Wordpress site running on sample.com
I have another Ghost site that I want to run on www.sample.com
Note: the first one doesn't have www prefix
However when I try to access www.sample.com my browser instantly shows my Wordpress site at sample.com ( the one without www )
I can not narrow down where this setting is being enforced at.
I figure it either has to be in the Linode DNS settings -OR- in the nginx server settings. I can't find anything indicating that there should be a redirect of any kind.
Ammendment: On the nginx side, there is are two configuration files. The default server config file is pointing to the Wordpress installation which is loading for both www and non-www cases.
Ammendment: The remaining 1 configuration file is pointing to the Ghost installation.
Ammendment: When using the same two configuration files, but only changing the hostname to be "mail." instead of "www." the ghost installation loads just fine. The "mail." host was already registered in the dns settings, so I just borrowed it as a test.
What am I not consdering?
I'm not quite sure what happened. But, 24 hours later, the problem went away. Somewhere in the pipeline, old host/ip/port sets were getting cached and I couldn't resolve where. But, now it's working fine.
Thanks Richard Smith for taking time to talk me through it.

Rails 4 Capistrano3 Deploy Setup

I have Rails 4 application setup under version control, I was running it on puma server on the staging environment. Now I decided to use capistrano3 for deployment, I added the necessary gems and everything. I can even run cap staging deploy successfully and the puma server start. But when I load the URL in the browser, I see the default apache config page saying, congratulations the server is set up.
I tried all the common ports after URL in the browser, but none of them works. I think I'm extremely close, but missing a key(and silly) piece in the puzzle. Can anyone help out?
Make sure that the location is correct. I assume that puma is being proxied to from Apache, but Apache is serving the assets. It sounds like you need to verify that the vhost is correct, and it is actually proxying to the right port. Check the apache logs for this. You can set a custom log on your vhost like:
ErrorLog /var/log/apache2/myapp-error_log
CustomLog /var/log/apache2/myapp-access_log common
Also, make sure that Apache is pointing to the correct directory for the assets. It will probably be something like /var/www/myapp/current/public.
Other than this, you will need to do some more debugging. Stack Overflow is usually more helpful if you have a specific problem or error to address.
Good luck!

Error when trying to open my localhost

Hello guys
i have installed wamp server Version 2.0 .. and i have tried some things and every thing ok ..
i have reboot my Desktop then some thing goes wrong when i am trying to open my local host
EMDAEMON
HTTP/1.1 404 , Not Found
should i consider re-installation ??
Reboot desktop? Open your local host? If you want to do web development you should get familiar with basic computer terminology, at least to a point when you are able to make questions that make a minimum sense.
I'll assume you have installed a bundle that includes the Apache web server and you want to configure a virtual host that's served when you load http://emdaemon in your web browser. The exact details to do so vary slightly depending on your platform. Being a newbie, I suggest you reuse the main site that's already configured and can be loaded through http://localhost. It's roughly explained at http://www.wampserver.com/en/presentation.php. Leave multiples sites for the future :)
Solved .... it seems that we have conflicts in ports ..change port in apache make it works

Rails 2.3.8 in IIS6

My server is running on IIS6, and i having trouble with setting up rails with IIS.
1st) is there any posible way to run Nginx on a domain:80 while therest:80 are running on IIS?
2nd) How should I make it work on IIS6 because despite follow the instruction here http://mvolo.com/blogs/serverside/archive/2007/02/18/10-steps-to-get-Ruby-on-Rails-running-on-Windows-with-IIS-FastCGI.aspx , I just can't get it to work. Result is a "Directory Listing Denied" error.
Thank you very much.
I see two options if IIS is a necessity:
I would propose to investigate IronRuby, which integrates better with IIS.
Otherwise I would run nginx on another port, and let IIS forward a certain path to that instance.
Personally i have deployed on windows, but just used apache and a mongrel-cluster.
When i was looking at it, IronRuby did not yet offer the integration with IIS; and i found very little information concerning how to configure IIS to do what i wanted.
Good luck! :)
1.) No, there is no way you can have 2 different programs running on the same port, it's simply not possible. But you can change either one to run on different ports (for example, if you want Nginx as the "primary", give it port 80 and change IIS to 8080 or whatever). Or, as #nathanvda mentions, you could use a redirect script from one to send certain paths to the other (port & path).
2.) The "Directory Listing Denied" error suggests that either (a) you haven't set the directory permissions correctly in IIS--be sure that Execute Permissions allow scripts in all your Ruby directories, or (b) the handler mapping which directs files to use the Ruby interpreter via FastCGI is not set correctly--double-check step 8 or check other sources for more details on this setting.

Symfony with only FTP access

I'm currently developing on my local pc, to which I have complete access of course.
However to my production server I have only FTP access.
Now, this step
http://www.symfony-project.org/getting-started/1_4/en/05-Web-Server-Configuration
On Symfony's installation guide, suggests that I need to edit the httpd.conf
I was wondering if there's an alternative since I don't have access to it on production.
Try reading this. I haven't tried installing Symfony on a shared host, but I see no reason for it not to work.
Generally shared hosts allow you to set configuration parameters in .htaccess files, so you can override httpd.conf without modifying it.

Resources