Running Apache Dev/Test server locally - php

Is there any way that I can set up Apache to run locally, specifically NOT connecting to the internet, so that it may serve dynamic content (PHP) over a LAN?
I'm trying to set up a development environment on my Windows XP SP3 box and gain some experience with building web PHP driven web applications. I have residential Rogers service, and it's a violation of the TOS to have a server running over that connection.

Umm yes. Just download apache and fire it up. The only way it's going to get to the outside is if you specifically open up ports in your firewall/router to let http traffic in and route it to your machine. And if you're serious about getting some experience, ditch XP and get a quality linux distro on your "development" box. You can always remote desktop or ssh to it from a windows machine if you feel more comfortable that way.
My experience has been that many hosting companies use CentOs for their client servers, so I'd recommend trying that first if the purpose is gaining useful experience.
Oh by the way, Linux happens to be free.

You can use WAMP. It installs everything you'll need to get a testing server up and running in minutes

Using a packaged solution like WAMP or XAMPP will provide you with the basics for setting up an Apache web server + PHP + MySQL + the phpMyAdmin interface for working with MySQL outside of the command line.

Related

How to deploy a php web app behind firewall?

Does anyone know a solution for deploying a PHP webapp behind a firewall on mainly Windows servers? We have 100+ customers who host our webapp on premise, and we would like to setup a deployer, as a part of our bitbucket pipeline, so our code gets deployed on all installations.
1 customer = 1 installation aka deployment
Today we use a small PHP script, and some version control software, to pull code changes once every day. It runs on both Linux and Windows servers.
Hit me with any solutions :)
You can make use of PHPDeployer.
You can setup SSH-access on the servers and then configure the script to deploy to the desired IP of the server.

Questions about Remote Test Servers

First, I am a complete novice when it comes to programming, so pardon my ignorant questions.
I hired two programmers to work on my project. They say they need a remote test server for testing things, before making it live, so that the changes are not live until all are okay.
My questions:
What are Remote Test Servers?
Why are they necessary?
Can they be set up with normal reseller or shared hosting?
How can you prevent the world from seeing what's on it?
Do you need a domain name for this?
How do I go about setting up a remote test server?
Any other comprehensive document to read up on this?
Thanks.
About Test Servers
A test server, in the case of websites, is used for changing around a website ( a copy ) without it being displayed to the public. This is done because, when a developer changes a webpage, the page will often seize to function or contain bugs due to incomplete changes of the source code. By putting these pages on a remote test server, the developers can use copies of the website - that are placed on this server - to make changes without affecting the pages that are being sent to the clients. You can actually configure this kind of server locally or remotely, depending on how you weigh the pros and cons.
Remote Test Server
You may set up a remote test server on sites like GoDaddy or DynDns. These services usually package a domain name with their server space. The benefit of this is that most of the 'set up' is already done for you. Also, as Silvertiger has pointed out, the service fees of this are usually quite low. This might be recommended because the massive amount of software your programmers may need is readily available on these servers. The only downside is that the only way to prevent the public from viewing this ( that I know of ) is to make it password protected. However, you may need public access anyway if your developers plan on working outside of your work environment.
Local Test Server
Alternatively, you may set up one of your own computer as a test server. The benefit of this is that the only fees you will have to pay are the costs of the computer ( it can be a low-end computer ). Since this computer would be connected to the network you wouldn't need a domain name, instead you will use an IP address assigned to the machine. It won't be hosted on the internet, so it's much easier to prevent other people from seeing it. The only downside is that your programmers must be within your network to work and setting this server up may be rather involved ( depending on the needs of your programmers ).
You will mainly have to download and configure all the appropriate software ( ie Apache, mySQL, PHP ) to get it working. This is typically done on a server OS ( ie Ubuntu Server ), but can be done on most operating systems. This process can also be made less painful by installing server software packages ( ie WAMP, LAMP, MAMP ), which include the basic software components your developers will need. I would recommend using Ubuntu. You may use Ubuntu Desktop if you'd like to keep a graphical interface during set up. Or, you may use Ubuntu Server - which saves a lot of memory by using a terminal-based user interface ( can make it more difficult to use ).
You may additionally consider adding a service called FTP to a local server. This is a service that allows you to remotely read and write to files on the server, and may be desired by your web developers for some of their editing programs ( Dreamweaver, for instance, can access files with FTP ).
As a side note, most developers should be familiar with setting up basic server software. In fact, it is usually part of the curriculum in webdesign. So, you may allow them to configure this software if you provide the computer for them. If you otherwise would like to configure it yourself, you may find some of the links following to be helpful.
Informational Links
General Web Servers
Wikipedia - general information on web servers
HowStuffWorks - information on how web servers work
Remote Servers
Godaddy - A common web hosting company from which you may use their service.
DynDns - ( as the aforementioned )
Local Servers
Ubuntu Server : A popular OS for servers
Apache : A popular HTTP server ( aka Web Server )
PHP : A commonly used language by web developers
LAMP : A package of basic server software for Linux ( Linux Apache mySQL PHP )
WAMP : A package of basic server software for Windows ( Windows Apache mySQL PHP )
MAMP : A package of basic server software for Mac ( Mac .. .. PHP )
Setting up LAMP : [Steps 1-5] A wonderful article on setting up a web server on Ubuntu.
A remote test server is a working php server that you can execute code on. It can be any server you have access to meaning that any reseller of hosting can provide you with a server but effectually it is just a web server you have access to. I presume you have a software that is asking for a remote test server like Dreamweaver or some other IDE.
I use my godaddy $8 a month hosting account account for testing..

Team development with node.js on a shared dev environment

How does one do team development with node.js when all the developers develop on the same dev machine?
Right now the dev server setup has nginx and apache. Developers SSH into the dev server and they have their own subdomained sandboxes to work on (database is shared). They hack their code and they check into the SVN repo. Great, works fine....until we started using node.js.
It seems node is not like apache or nginx where there's an independent server that serves up code. In node, the server AND the app code is tied together, so what happens is each developer will need to start and stop the server when changes are made. This creates a problem if one instance is started, it blocks the port for other developers.
I'm also having trouble figuring out how to put the node code into the same SVN repository as the PHP app code.
A friend told me the developers can do "timesharing" where the node code can only be modified by someone in a specific timeframe. Not sure if this process is scalable.
Another option is to have everyone work locally off their computer with a VM copy of the dev server so they can develop independent of the dev server. This requires a lot of infrastructure change and I'm not ready to do that yet.
Any suggestions on how to do this with the current shared dev environment setup?
Also, the reason why we are using node.js is to have good comet support. But if this is becoming a blockage to our current infrastructure, I'm willing to try other technologies and servers that is similar to how nginx or apache works--so that it is independent of the app code and can be compatible with our current development environment.
PS. I tried the nginx http push module. It's not well-maintained and not many updates. Scared to use it in production.
You could have each developer's instance of Node.JS running on a different port.

setting up remotely accessible wamp server along with iis

I am new to Windows IIS and I need to run a php/mysql application on it. For local php development on windows, I have found WAMP to be the easiest.
But can WAMP be used in this case instead of installing php and mysql separately ?
This needs to be done on an ec2 Windows 2003 instance. So far, I have already tried installing WAMP and setting up apache to listen on port 8080 instead of 80. From inside the remote desktop, both IIS and WAMP work properly in parallel on their respective ports.
However, when I try to connect from another computer using the ip address http://184.**.***.***, IIS works fine serving the default web page but cannot connect to apache on http://184.**.***.***:8080.
Is it possible to use WAMP at all for this purpose and if yes, would there be any disadvantages in using it instead of installing php/mysql seperately ?
Edit :
I dont know if this is a problem of blocked 8080 port. To verify this I stopped IIS and configured apache to listen to 80. Even then http://184.**.***.*** doent show the WAMP homepage. IS anything needed to be configured in IIS ?
RESOLVED :
Added the port 80 in Windows Firewall Exceptions and it started working.
Also, its necessary to select "Put Online" in the WAMP tray otherwise it gives a forbidden response as suggested by some answers.
Thanks
I haven't used EC2 in this way before, but broadly speaking, I'd encourage you to use the same server for development and production environments if at all possible - the installation effort can be a bit of a pain, but it's nothing compared to developing an app locally and then finding an IIS configuration issue causes it to break on production.
This approach also lets you keep your PHP configurations in source code control - php.ini and any modules you're using - and automatically deploy them alongside your application; again, forgetting to deploy the correct PHP.ini usually makes your application do crazy things...
So, your choices appear to be:
- switch off IIS and have WAMP listen to port 80. Not sure WAMP is designed for production level traffic, but in the past, I've run low-traffic public websites in this way.
- work out why port 8080 is blocked, and if it can be unblocked. This would still require you to run your website on an unusual port, which makes for ugly and hard-to-communicate URLs.
- install PHP on your IIS instance. One benefit of having installed WAMP is that MySQL should already be up and running, and the basic PHP installation should also be there; getting PHP to run on IIS is no longer a dark art ([http://php.iis.net][1])
For my money, I'd go for the latter option...IIS is a production quality server, and it's clearly what Amazon want you to use in this instance.
Of course, running IIS on your development environment may be a problem.
Have you put the server online? Think it is offline by default, meaning it's only accessible from your local machine. It's an option in the systray menu to put it online.
If I remember well, there is an option "go public" (or "put online") on the system traya icon of wamp.
This option modifies the httpd.conf to authorize public access.
You should give a try.
On a side note, you can make php work with IIS. This is another option to help you manage your server. (Mysql and Php have to be installed separatly but, this is very easy to do as far as I remember :) )

The Localhost of visual studio doesn't show up when I have WAMP server installed. How do you make it work?

I've first installed the WAMP server on my system.
It used http://localhost to show my files in the www directory.
But then I installed visual studio 2008. It too uses the http://localhost/
But it doesn't show up. What should I do?
I assume you mean IIS? Cassini (the build in "debugging" webserver) uses high ports when you fire an app up. Either way you need to configure either WAMP or IIS to listen on a port other than port 80, then you can access one on http://localhost/ and one on http://localhost:MYPORT/.
VS uses it's own development server, and usually VS starts his own server in debug mode, and there isn't a common server executable. Since VS needs to start it's own server in debug mode to test .NET driven applications, it can't show your WAMP applications because it usually runs in other port. Also, you can't run PHP applications under VS.
Try looking at server connection that the browser brings you at the application URL.

Categories