Text
Installing PHP
In this post I will be showing how to install PHP on Windows. I am using it alongside Apache which I instructed on how to install in my last post (also found in the navigation bar) so I would advice going through that first if you haven’t.
Start by opening your browser and going to https://www.php.net/downloads.php
From there make sure to find the Windows downloads options and download the Thread Safe X64 version.
Quickly go to your C:/ drive and create a folder called “php. You will then extract the contents of your newly downloaded zip file into this file.
Next navigate into that php folder There find the file called “php.ini-development”. Right click and copy it. Rename the copy “php.ini”.
Open php.ini in a text editor and find the lines below to uncomment (delete the semicolon[;])
extension=curl extension=gd extension=mbstring extension=mysqli
If there are others you know to be applicable for your wants, use your discretion.
Now lastly, we have to make sure PHP can be found by windows.
Go to the search bar and look for “environment”
select on “Edit Environmental Variables for your account”
scroll down to System variables section
scroll within System Variables to find Path
select path, then add C:\php
Click OK to confirm changes and exit the Environmental Variables.
Now that we have PHP installed we can connect it with Apache for usage.
Navigate to the Apache24\conf\ folder and open httpd.conf with a file editor. Scroll to the bottom and insert the following text.
#php Module PHPIniDir "C:/php LoadModule php_module "C:/php/php8apache2_4.dll" AddType application/x-httpd-php .php
Account for changes in file placement if you didn’t folders where I have.
Also edit the following text found in httpd.conf
<IfModule dir_module> DirectoryIndex index.html </IfModule>
To include index.php, as shown in the screencapture.
Go to Apache24\htdocs and create a new file called “index.php”. Make sure it has the following text in it.
<?php phpinfo(); ?>
You should be able to see the php page in browser now!
0 notes
Text
Configuring SSL & Port Redirects IIS
In this post I will explain how to configure SSL Certificate in iis. This is under the assumption that you have already hosted a site using iis that you applying ssl to.
To start, open your Internet Information Services (iis) Manager. Then, find where it says “Server Certificates.”
Click on it. Insite on the righthand click on the option that says “Create Self-Signed Certificate”.
Name the certificate whatever you please though I have named mine the same as the site I intend to use it on to stay consistent. I have kept the certificate store as being set to “personal”.
Navigate to your created site in the left hand side after creating your certificate. Click on “Bindings” on the righthand”.
Set the Type to “https”, the IP address to “All Unassigned”, and the port to “443″. Enter the name of your site as the “Host Name” and finally, make sure to select the certificate you created for your sit as the SSL certificate. The press “OK”.
Add a second binding. Set the Type to “http”, the Ip address to “All Unassigned”, and the port to “80″. The Host name should be the exact same as your site, just like the last binding.
Go back to your Site’s home and select “URL Rewrite”.
In the righthand side select “Ad Rule(s)...”
Select “Blank Rule”
Name the rule whatever you please, since this is going to be our redirect though I’d suggest naming it something relevant.
“Request URL” should be set to “Matches the Pattern”. “Using” set to “Regular Expressions”. Input “(.*)” into the Pattern and check to “Ignore case”.
Set “Logical Grouping” to “Match All”, then click “Add...”.
Set “Condition input” to “{HTTPS}, “Check if input string” to “Matches the Pattern”, and “Pattern” to “^OFFS”. Check to “Ignore case”.
Set “Action type” to “Redirect” and “ Redirect URL” to “https://{HTTP_HOST}/{REQUEST_URI}”. Uncheck “Append query string and set “Redirect type” to “Permanent{301}”.
Click apply and you should now have your site set up with ssl bindings and a redirect!
0 notes
Text
Installing MariaDB
In this post I will walk through installation of Maria DB
To start go to https://mariadb.org/download/ and download the latest version.
Run the installer found in our downloads.
Agree to the End-User License Agreement then click next.
Create new Database Instance then lick next.
Select prefeed file location, though I will be leaving it as default.
Set your password however you like.
Make sure “Enable access from remote machines for ‘root’ user” is unchecked.
“Use UTF8 as default server’s character set” should be checked
Select to install as service and enable networking. You can change the port to your own if wanted, but not necessary, as well as customize the page size. I will be continuing with default.
Finish installation!
All finished! Now we just make sure it is running by going to your search and bring up your Services application and find MariaDB!
In the start menu it will also show under recently added in the start menu! I would recommend pinning it to start! The files can also be found under M!
0 notes
Text
Installing Apache for Windows
& Creating Two Sites!
In the post below I will be walking through how to install Apache as well as using it to create two sites.
To start off go to https://www.apachelounge.com/download/ and download Apache. I am using the version captioned below, if the Win64 version is applicable for, then so is this tutorial.
Navigate to your downloads folder through your files manager and extract your newly downloaded zip folder by right clicking and selecting “extract all”. I leave my extracted version in downloads.
Open the extracted folder. Inside is another folder called “Apache24″. Right click and copy that file and put it in your C:/ drive.
Now that Apache is installed we can make out first server!
Navigate to inside the Apache24 file in C:/ drive. There is a folder called Bin, and within that is a file called httpd.exe.
This file is the default server for Apache. We will come back to it soon.
Search for Command Prompt in windows search and open it as administrator.
Navigate to the root directory. (I use the cd .. command twice).
Then navigate to bin (cd apache2/bin/).
From there all we have to do is run the httpd.exe file. To do so we can simply type in httpd.exe and enter
You won’t see any text or popups which may mislead you to think the command didn't work. However httpd.exe is actually running within the command prompt now! So long as you don’t close the prompt our default apache server will run!
We can see that it is working by opening up our browser of choice and searching “localhost”. You should see the classic “It Works” Apache default page if everything goes accordingly!
Of course, if we were to close the command prompt and refresh the page it would break again, since we are only running Apache from that Command prompt. Why don’t we make things a little more long lasting?
Lets register Apache as a system service instead, so it can run with the command prompt closed!
To do so open your command prompt again
Navigate back to the C:\Apache24\bin\ directory as we had before.
Enter the command “httpd.exe -k install”
Now Apache24 is installed as a service! We can check his by going to our search bar and finding the “Services” application.
Apache24 should be relatively close to the top of the Services listing.
Select Apache24 and start it.
Now Apache24 is running as a service, without the command prompt! We can see that it works by checking on our localhost browser again and finding it set to the Apache24 default page again!
Now we can make our own server! Navigate to C:\Apache24\conf\httpd.conf
Open httpd.conf with a text editor. Find the line “#Include conf/extra/httpd-vhosts.conf” and edit it to be uncommented (delete the # )
Don’t edit anything else. Save and close httpd.conf.
Navigate to C:\Apache24\conf\extra\httpd-vhosts.conf
Open httpd-vhosts.conf with a text editor.
This file will execute sites we write in. Right now it had two example defaults. We are going to use these defaults to model out own site.
The bare minimum for a basic server is as highlighted.
I have edited it to make out own site. You may use whatever site name you want. I will be using the ServerName apache.tbd and the DocumentRoot “${SRVROOT}/htdocs/apache.tbd”
Now we go to the file we said out server would be in! I put mine in apache24/htdocs. Inside the file we create a new file and make sure to name it the same as our server.
Inside that folder create a new text file and call it “index.html”. Open it with your text editor and add dialogue of any kind.
Make sure to save and exit, this index.html will act as our test homepage!
Now we just need to restart the server! Lets go back to our Services application. We want to select our Apache24 and select to restart.
There is only one last thing to o before our site will be visible. Open up notepad and search for C:\Windows\System32\drivers\etc\ and open the hosts file.
Make sure you set to see all files, not just txt files, or else you won’t be able to find it!
Find where it gives your localhost ip
then you can type in your localhost ip alongside your site name as shown.
Save the host file. Now we travel back to our browser and search up our new site ! (http://apache.tbd) It is recommended to search with the http:// included manually so the browser knows to go to an exact site, and not to initiate a search.
We can create a second server very easily doing the same as above!
I name this server apache2.tbd in the httpd-vhost.config file. As well as making a similar file and index for it in the DocumentRoot specified.
Finally, we of course edit the host file to listen for our second site! Use the same localhost ip.
After restarting apache24 in Services we can go to our browser and look up your new site!
Apache24 will run both sites at the same time! We now have Apache installed and two sites running!
0 notes
Text
Introductory Post
Hello, I am an It student who will be making posts about various application installation as a part of a project.
0 notes