PDA

View Full Version : Setting up a server


Radon3k
Sun 24th Mar '02, 4:50pm
I think I made a post about this before, but I'm not sure. Wasn't sure where to put this b/c it's not really "vBulletin" related, so I put it here.

I'm going to be setting up a server out of my home to run my web page. What I need to know though, is how I go about doing it. What software will I need? It will be running Linux RedHat 7.2 and I want it to be able to have ASP, PHP/MySQL, ASP.NET, and all that other good stuff...One thing I'm confused about though, is the DNS server. When I go into it and change it via my registrar, what do I set it to? My IP? Or do I have to buy one? Or are there free ones?

Any help on how to go about setting all of this up would be greatly appreciated! Thanks! :)

Radon3k
Sun 24th Mar '02, 5:30pm
I see this got moved, okies, at least it's in the right place now, thanks to whoever moved it! :)

I realized that I do have my own name server for some reason, but I have that...weird...

nuno
Sun 24th Mar '02, 5:37pm
ASP with RH? :confused:
is that possible?

Radon3k
Sun 24th Mar '02, 5:47pm
I thought you could have it if you ran Apache Web Server, or is that only on UNIX servers?

nuno
Sun 24th Mar '02, 5:51pm
i thought ASP would only be possible with IIS, but i may be wrong

Chris Schreiber
Sun 24th Mar '02, 5:58pm
ASP runs best on IIS servers.... however, you can buy ChiliSoft (~$500) to get ASP emulation for Unix servers: www.chilisoft.com

Radon3k
Sun 24th Mar '02, 5:59pm
Ok minus the ASP part then :D

Legacy
Mon 25th Mar '02, 2:37am
Install Apache and php on Windows System



1. Go to http://www.apache.org/ and download the latest version of the Windows binary file (with
the *.exe extension). This file is pre-compiled and ready to install.
2. Once you have the file on your hard drive, run the executable file by double-clicking it or typing its location in the Run
dialog box under the Start menu.
3. The installation wizard will start. Read and accept all the licencing stuff.
4. The installation wizard will ask for:
a) The Apache installation directory. Default is "C:\Program Files\Apache Group\Apache" but you can change this to
"C:\Apache\" or anything else you wish.
b) The name that will appear in the Start menu; default is "Apache Web Server".
c) The installation type: typical, minimum or custom. I usually pick "typical".
5. Sit back and watch the pretty colors as the installation sequence runs through its paces. The wizard will tell you when
it's finished, and ask if you want to read the README. If you want to, do so. If not, just Finish the install.
During the installation process, a default set of configuration files will be placed in the "conf" directory, under the
installation directory (i.e. "C:\Program Files\Apache Group\Apache\conf\"). Using a text editor, open the httpd.conf file,
located in your Apache configuration (conf) directory.
In httpd.conf, find this line:
ServerAdmin you@your.address
Change it to real values, such as:
ServerAdmin joe@schmo.com
Find this line:
#ServerName new.host.name
Change it to something like:
ServerName localhost
For now, at least. If you have a real machine name, like gambit.yourdomain.com, go ahead and use it.
Now you'll try to start Apache.
If you're on Windows NT and you want to run Apache as a service:
1. Select "Install Apache as Service (NT only)" from your Start menu.
2. Start the service named "Apache" by opening the Services window in the Control Panel, selecting "Apache" and clicking
the "Start" button.
3. Apache will now continue to run in the background, and will automatically start whenever your machine starts.


If you're not on NT and need to start Apache on your own:
1. Select "Start Apache" or "Start Apache as a Console App" from the Apache folder in the Start menu. A console window
will open and Apache will run. Keep this window open!
2. Yes, that's really it.
After starting Apache, open your Web browser and type: http://127.0.0.1/ or http://localhost/ to see the default
installation page, containing links to the Apache web site and the Apache manual. If your installation fails at any point,
read the Apache documentation and the Apache FAQ to attempt to pinpoint your problem, then try again.
Now let's get PHP4 hooked in there...
1. Go to http://www.php.net/, go to the "Downloads" area, and select the link for the Windows binaries. This is a zip file,
containing pre-compiled binaries, ready to install. If you want to build from source, then you don't need me or this
tutorial to tell you what to do.
2. Once you have the file on your hard drive, use your favorite un-zipping tool to extract the contents to say, C:\php4\ (If
you put the files in some other directory, substitute that directory where appropriate, later in this process.).
3. Take the file called "php.ini-dist", rename it to "php.ini" and move it to C:\WINDOWS\ or wherever you usually put your
*.ini files.
4. Forget about that file for a moment.
5. Take the two files "Msvcrt.dll" and "php4ts.dll", and put them in C:\WINDOWS\SYSTEM\ or wherever you usually put
your *.dll files. If your system tells you that you already have "Msvcrt.dll" or it's currently in use, that's fine. As
long as you have it.
6. Forget about the other *.dll files for now.
Let's go make a few modifications to the Apache configuration files, and run a vanilla version of Apache + PHP4. Then we'll
go back and tweak on PHP a little bit.
Using a text editor, open the httpd.conf file again. The goal of these changes configuration is to tell Apache what to do
with files ending with .phtml, .php or anything else you use to indicate a PHP file. Basically, you'll be telling Apache to
execute an application in order to do something with those files; in this case, run the php.exe program to parse the PHP
code.
Find a section that looks like this:
#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ "C:/Apache/cgi-bin/"
You need to add another ScriptAlias line:
ScriptAlias /php4/ "C:/php4/"

Now find a section that looks like this:
#
# AddType allows you to tweak mime.types without actually editing it, or to
# make certain files to be certain types.
#
# For example, the PHP3 module (not part of the Apache distribution)
# will typically use:
#
#AddType application/x-httpd-php3 .phtml
#AddType application/x-httpd-php3-source .phps
Although the example is now out-of-date, since you'll be using PHP4, you get the idea. This is the area where you say "for
all files ending with [whatever], consider them to be of [whatever] type." Add these lines:
AddType application/x-httpd-php .phtml .php
AddType application/x-httpd-php-source .phps
If you want to create your own file extension for PHP files, like .joe (really, you can...), add .joe after the .phtml and .php
in the first AddType line.
One more modification...find a section like this:
#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#
You need to add an Action line for your new file types, so that they get sent through the PHP parser. Add this:
Action application/x-httpd-php /php4/php.exe
I know it looks weird, without the drive letter, the slashes are backwards, there aren't any quotation marks, but this is
how you do it. That /php4/ comes from the ScriptAlias line at the beginning of the file, so Apache knows that /php4/
really equals C:\php4\ ("C:/php4/" == "C:\php4\" in Apache world).
Alrighty then, let's try to start Apache again (shut down and restart Apache if it's still running). Provided there are no
issues on startup, open a text editor and type this:
<? phpinfo() ?>
Save this file as phpinfo.php, and put it in the document root of Apache (in the htdocs directory within your installation
directory.).


Fire up your Web browser and go to http://localhost/phpinfo.php -- you should see a page that starts out like this:
If you don't, then something has gone awry, and let me know.
So what is all this stuff? It's "info"...and a ton of it! The phpinfo() function produces this page that shows you what sorts
of things are installed, your environment, your settings, and so on. The following list shows you the basic, compiled-in
stuff:
• Regular Expressions
• Dynamic Library Support
• Internal Sendmail Support
• PCRE Support
• ODBC Support
• Session Support
• XML Support
• MySQL Support
• BCMath
• WDDX
This means that for the elements in the list above, you do not need to go out and find additional *.dll files. However, if
you need Image Creation functions, Crypt functions, other database connectivity support functions, you need to go off and
find the *.dlls for those things. A quick search of the mailing list archives should prove useful...what you'll probably find
is a link to http://www.php4win.de/, where some PHP developer have donated time and energy to maintain up-to-date
compilations of *.dlls for you to use. If you have any problems with the *.dll files you get from that site, remember to
take that up with them, not me....
Alright, time to go back and tweak on the php.ini file. Use a text editor to open the php.ini file in C:\WINDOWS\ or
wherever you placed it. The following changes are optional or just FYI.
For sending mail, find these two lines:
SMTP = localhost ;for win32 only
sendmail_from = me@localhost.com ;for win32 only
Setup and Install Apache + PHP4 on Windows (cont’d)


Change these to something useful, like:
SMTP = mail.yourdomain.com
sendmail_from = you@yourdomain.com
If your outgoing mail server is mail.yourdomain.com and your e-mail address is you@yourdomain.com, that is.
To use additional *.dlls, put them in C:\php4\ and uncomment their entry in this block:
;Windows Extensions
;extension=php_mysql.dll
;extension=php_nsmail.dll
;extension=php_calendar.dll
;extension=php_dbase.dll
;extension=php_filepro.dll
;extension=php_gd.dll
...
"Uncomment" means to take away that ";" at the beginning of the line. Notice that there's a line for the php_mysql.dll file,
but remember, that's already compiled in for you.

Radon3k
Mon 25th Mar '02, 5:18pm
Wow, that's a lot of info. Thanks! I really appreciate you taking the time to write all of that! :)

I'm going to print this and get working on it ASAP. Thanks again sir!! :)