Setuping a server for web hosting – part 4: Installing PHP

Posted by Alesandro Slepčević | Posted in Servers, Windows and Powershell | Posted on 14-04-2010

1

Hello after a very long pause :) . Continuing the “Setuping a server for web hosting” series with the new smashing video of how to install PHP on your machine! AWESOME right? :)

In the very begining of the post, lets learn what PHP is exactly.

So, Wikipedia says ( and I add that I agree with her :) :

PHP: Hypertext Preprocessor is a widely used, general-purpose scripting language that was originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document. As a general-purpose programming language, PHP code is processed by an interpreter application in command-line mode performing desired operating system operations and producing program output on its standard output channel. It may also function as a graphical application. PHP is available as a processor for most modern web servers and as standalone interpreter on most operating systems and computing platforms.

Don’t run production ASP.NET Applications with debug=true

Posted by Alesandro Slepčević | Posted in Servers, Windows and Powershell | Posted on 29-11-2009

0

Found an awesome post on DotNetPanel blog so I had to repost it :)

One of the things you want to avoid when deploying an ASP.NET application into production is to accidentally (or deliberately) leave the <compilation debug=”true”/> switch on within the application’s web.config file.

Doing so causes a number of non-optimal things to happen including:

1) The compilation of ASP.NET pages takes longer (since some batch optimizations are disabled)

2) Code can execute slower (since some additional debug paths are enabled)

3) Much more memory is used within the application at runtime

4) Scripts and images downloaded from the WebResources.axd handler are not cached

This last point is particularly important, since it means that all client-javascript libraries and static images that are deployed via WebResources.axd will be continually downloaded by clients on each page view request and not cached locally within the browser.  This can slow down the user experience quite a bit for things like Atlas, controls like TreeView/Menu/Validators, and any other third-party control or custom code that deploys client resources.  Note that the reason why these resources are not cached when debug is set to true is so that developers don’t have to continually flush their browser cache and restart it every-time they make a change to a resource handler (our assumption is that when you have debug=true set you are in active development on your site).

When <compilation debug=”false”/> is set, the WebResource.axd handler will automatically set a long cache policy on resources retrieved via it – so that the resource is only downloaded once to the client and cached there forever (it will also be cached on any intermediate proxy servers).  If you have Atlas installed for your application, it will also automatically compress the content from the WebResources.axd handler for you when <compilation debug=”false”/> is set – reducing the size of any client-script javascript library or static resource for you (and not requiring you to write any custom code or configure anything within IIS to get it).

What about binaries compiled with debug symbols?

One scenario that several people find very useful is to compile/pre-compile an application or associated class libraries with debug symbols so that more detailed stack trace and line error messages can be retrieved from it when errors occur.

The good news is that you can do this without having the have the <compilation debug=”true”/> switch enabled in production.  Specifically, you can use either a web deployment project or a web application project to pre-compile the code for your site with debug symbols, and then change the <compilation debug=”true”/> switch to false right before you deploy the application on the server.

The debug symbols and metadata in the compiled assemblies will increase the memory footprint of the application, but this can sometimes be an ok trade-off for more detailed error messages.

The <deployment retail=”true”/> Switch in Maching.config

If you are a server administrator and want to ensure that no one accidentally deploys an ASP.NET application in production with the <compilation debug=”true”/> switch enabled within the application’s web.config file, one trick you can use with ASP.NET V2.0 is to take advantage of the <deployment> section within your machine.config file.

Specifically, by setting this within your machine.config file:

<configuration>

<system.web>

<deployment retail=”true”/>

</system.web>

</configuration>

You will disable the <compilation debug=”true”/> switch, disable the ability to output trace output in a page, and turn off the ability to show detailed error messages remotely.  Note that these last two items are security best practices you really want to follow (otherwise hackers can learn a lot more about the internals of your application than you should show them).

Setting this switch to true is probably a best practice that any company with formal production servers should follow to ensure that an application always runs with the best possible performance and no security information leakages.  There isn’t a ton of documentation on this switch – but you can learn a little more about it here.

So, dear developers, keep on eye on debug state…it will make you and the server happier :)

ALL CREDITS OF THIS TEXT GO TO DOTNETPANEL BLOG!

Source : DotNetPanel Blog

Setuping a server for web hosting – part 3: Installing MySQL

Posted by Alesandro Slepčević | Posted in Servers, Windows and Powershell | Posted on 01-11-2009

0

Back by popular demand :) part 3 of the “setup my web server” tutorials :)

In this post we will cover the instalation of MySQL on a Windows 2008 R2 based server. The process is the same if you would have a Windows 2003 machine also.

At the beginning, lets see what MySQL is.

MySQL is a relational database management system (RDBMS). MySQL stands for “My Structured Query Language“. The program runs as a server providing multi-user access to a number of databases.

The project has made its source code available under the terms of the GNU General Public License, as well as under a variety of proprietary agreements. MySQL is owned and sponsored by a single for-profit firm, the Swedish company MySQL AB, now a subsidiary of Sun Microsystems. As of 2009[update] Oracle Corporation began the process of acquiring Sun Microsystems; Oracle holds the copyright to most of the MySQL codebase.

MySQL is often used in free software projects which require a full-featured database management system, such as WordPress, phpBB and other software built on the LAMP software stack. It is also used in very high-scale World Wide Web products including Wikipedia, Google and Facebook.

Many web applications use MySQL as the database component of a LAMP software stack. Its popularity for use with web applications is closely tied to the popularity of PHP, which is often combined with MySQL.

So, what is the process of installing MySQL on a Windows machine? Well, it’s pretty straight forward so there is no need to write step-by-step tuturial..look at the video rather than reading :)

Dont forget to choose HD and the “full screen” option.

Song in the video is from Thievery Corporation. Song name is : Lebanese Blonde :)

Setuping a server for web hosting – part 2: Installing SQL 2008 Express

Posted by Alesandro Slepčević | Posted in Windows and Powershell | Posted on 24-10-2009

0

Hello there…

In order to  install SQL 2008 Express, we have to download it first . Fire up your favorite browser and point it to http://www.microsoft.com/express/download/ . After that, find the box with the SQL 2008 Express, and click download.

sqlexpress

On the next step you have the option to register with Microsoft or download the software without registration.  I will choose the “no registration part”.

sqlexpressdownloadpage

In the new window, choose the version you would like to install. Personally, I will choose “Runtime with advanced services“. By clicking on install, Microsoft will ask to install the Microsoft Web Platform installer. If you dont have it installed, click on the picture to install it.

webplatforminstaller

Choose “Run”, and after the download, again, choose “Run“. Wait for the installtion to finish and look at the top of the browser, a little bar will pop up and ask us if we want to run Active X control.  Make sure the publisher is “Microsoft Corporation”. Click on “Run“, and then on Allow.

Now, look at the video of the installation I have made for you. The video will show you the process of installing SQL Server 2008 Express.

After that, all you need to do is run the “SQL Server Configuration Manager” under “Configuration Tools” and configure it the way you want it.

BTW, the track used is La Noche by Coca & Villa .IT’s AWESOME!!!

Have fun…bye!

HyperV+ISCSI+Windows 2008 – yes..it works like a charm :)

Posted by Alesandro Slepčević | Posted in News, Servers, Windows and Powershell | Posted on 21-10-2009

0

Today, me and my collegaue managed to configure ISCSI on some backup server we had at the office. Iscsi target is based on OpenSolaris and ZFS . ZFS is a combined file system and logical volume manager designed by Sun Microsystems. The features of ZFS include support for high storage capacities, integration of the concepts of filesystem and volume management, snapshots and copy-on-write clones, continuous integrity checking and automatic repair, RAID-Z and native NFSv4 ACLs. ZFS is implemented as open-source software, licensed under the Common Development and Distribution License (CDDL). The ZFS name is a trade mark of Sun.

Requirements for running any OS in HyperV that will be stored on Iscsi server are:

1. Iscsi target, obviously :)

2.Iscsi initiator software ( bundled in Windows 2008 Server)

3. High speed network, atleast 1Gbit.

4. Drive that you connect to the HyperV machine MUST stay in offline mode.

5. Tons of time to configure it :)

Will you will be able to read more details about configuring OpenSolaris and ZFS on my collegaues blog : toic.org  – linux geek blog

So, like we already know, the disk on that we want to install the OS has to be offline  ( hint: disk2 ).

diskovi

hyperv

Next step is the creation of the virtual machine that will use the disk.  I have recorded that process, so you can see how simple it is :) .

All that you have to do is to install the OS…I didnt do that to the end in the video.

Tommorow we have planned to create a failover cluster with two Windows 2008 servers and see what will happen when one server suddenly get disconnected..ups :)

Bye, Alesandro

Powershell cheat sheet :)

Posted by Alesandro Slepčević | Posted in Windows and Powershell | Posted on 20-10-2009

1

Surfing all over the net, I found a very handy powershell cheat sheet that was put together by Ben Pearce. Anyways, here’s the download link (just click on the picture).

cheatsheet

Big hello to the guys from www.bug.hr :)

Installing IIS on Windows server 2008 R2 Standard – video tutorial.

Posted by Alesandro Slepčević | Posted in Servers, Windows and Powershell | Posted on 20-10-2009

0

Hi, last couple of days I have setuped over 10 Windows 2008 servers for hosting services for testing or production, so I am pretty bored with repeating the same stuff all over again :) , but, here’s a recorded video tutorial of one installation process. Because the video is pretty straightforward, I’ve decided that there is no need to explain every step of the installation.

Click on the HD button and put the video into full screen mode, so you can see all the details.

In the next post, I will show you how to install Microsoft SQL server 2008 Express .

Cheers!

How to setup a Windows 2008 Server for hosting usage?

Posted by Alesandro Slepčević | Posted in Windows and Powershell | Posted on 17-10-2009

1

No, I wont explain everything in this post. This post is just a annoucement, so you can know what will you read in a couple of next posts. We will cover the installation of IIS  7( Internet Information Services), MS SQL server, MYSQL server, PHP 5, Perl, Awstats and finally, integrating everything in DotNetPanel, the web hosting control panel for Windows Servers.  I will not explain or show how to install the OS on the server, because its a rudimentary and boring stuff :) , but being awesome, here’s a link to the video someone made :)

Add new ip or ip range to firewall rule using Powershell

Posted by Alesandro Slepčević | Posted in Servers, Windows and Powershell | Posted on 14-10-2009

0

firewalljpg

Tired of old point and click interface? :) Powershell is the new purple in computer world :) haha…Seriously! :)

So, here’s a little script that will add the Ip address you want to the existing firewall rule.

As you can see, it fairly simple, and there’s no need to explain it too much….


Function IP
{
param ($ipadress = $(Read-host "Enter IP address"))
$rule = "YOUR PREVIOUSLY CREATED RULE NAME"
Write-host "Adding address :" $ipadress -foregroundcolor "Red"
Start-sleep -s 5
netsh advfirewall firewall set rule name="$rule" new remoteip="$ipadress" action="allow"
}
IP

Only thing you have to do in the script is to enter your fireall rule name.

When you start the script, it  will ask you to enter desired ip address, and press enter. After that, wait 5 seconds and thats it :)

Cheers!

Is your server stable enough?

Posted by Alesandro Slepčević | Posted in Servers, Windows and Powershell | Posted on 13-10-2009

0

How many time did you find yourself in a situation where you need a reliable, stable and strong server? How to even determine if your server is stable enough? How to know what kind of continous load can it handle? Will it crash if it gets under heavy load for a couple of hours?  Well, today, I’ve found myself in a situation like that. I have installed HyperV on some server we have at the office and wanted to see how it will perfom under extreme heavy load and how stable everyhing was .

By extreme heavy load I assume about 200 concurent users clicking every 1-3 seconds on a random page that is being served on the server . When you look at the number of 200 concurrent users, you can say: ” Hey, 200 users isnt that big of a number for a server to handle” …and you would be absolutely right :) … if the server i was trying to “kill” didnt have 1 cpu core and 1 gb of ram assigned to it :) .

So..the point was to simulate real life conditions as much as possible. To do that, once more, I turned to Linux and the little piece of awesome software called “Siege”. You can download it here.  The software is able to simulate almost real user like behavior on a web page.  It can randomly open link in a specified interval, simulate 200+ users at the same time without any problems and so on.

To do some proper testing I’ve installed some php+mysql and asp.net+sql2008 applications to simulate a real-life scenario as much as possible. As we all know, one of pretty hungry applications for Linux is Joomla for the PHP+MYSQL combination and DotNetNuke for ASP.Net and MSSql combination. All cacheing  techniques on the application and the IIS were turned off so we can maximize the load to the server.

The server is based on Windows 2008 Server R2 Standard Edition and SQL Express 2008 .

I’ve told Siege to simulate 100 users on the Joomla site and 100 users on the ASP.Net site for 24 hours.  At this moment, tests are running for 6 hours and everything seems to be in perfect order. Here’s a couple of pictures :)

processcpu

As we like to say it..BURN BABY BURN! About 16 more hours to go under 100% cpu :) Results are coming soon…in about 20 hours :) more or less ….