<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Partha Biswas</title>
    <description>The latest articles on DEV Community by Partha Biswas (@partha7278).</description>
    <link>https://dev.to/partha7278</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F392547%2F875e6b58-08b9-43d8-95a4-82b58ed1b40b.png</url>
      <title>DEV Community: Partha Biswas</title>
      <link>https://dev.to/partha7278</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/partha7278"/>
    <language>en</language>
    <item>
      <title>Installing Wordpress with Nginx in Ubuntu</title>
      <dc:creator>Partha Biswas</dc:creator>
      <pubDate>Wed, 25 Dec 2024 19:04:38 +0000</pubDate>
      <link>https://dev.to/partha7278/installing-wordpress-with-nginx-in-ubuntu-2g45</link>
      <guid>https://dev.to/partha7278/installing-wordpress-with-nginx-in-ubuntu-2g45</guid>
      <description>&lt;p&gt;To install WordPress with Nginx on Ubuntu, follow these steps:&lt;br&gt;
&lt;strong&gt;1. Update your system&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Install required module&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install php-fpm php-mysql mysql-server nginx unzip php-xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Setup mySql (&lt;code&gt;Optional&lt;/code&gt;)&lt;/strong&gt;&lt;br&gt;
You can skip this if already done&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Configuring Nginx to work with PHP&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Goto nginx directory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /etc/nginx/sites-available
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Delete default (&lt;code&gt;Optional&lt;/code&gt;)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo rm default
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create Server Blocks for this Domain&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/nginx/sites-available/domain1.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Identify php sock version by following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls /var/run/php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following content (adjust paths and domain names as needed and php sock version from above):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server {
    listen 80;
    server_name domain1.com www.domain1.com;

    root /var/www/html/domain1.com;
    index index.php index.html index.htm;

    ssl_certificate  /etc/ssl/domain1.com.pem;
    ssl_certificate_key  /etc/ssl/domain1.com.key;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;  # Adjust PHP version if necessary
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create symbolic links in the &lt;code&gt;site-enabled&lt;/code&gt; directory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ln -s /etc/nginx/sites-available/domain1.com /etc/nginx/sites-enabled/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Test Nginx Configuration. Make sure the Nginx configuration is correct:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nginx -t
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart Nginx&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5. Configuring Wordpress&lt;/strong&gt;&lt;br&gt;
Downloading Wordpress to the Ubuntu server&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /var/www/html/domain1.com
sudo wget https://wordpress.org/latest.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Extract the file to domain1.com&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo unzip latest.zip
sudo mv wordpress/* .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remove unwanted files and folders&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo rm latest.zip
sudo rm -R wordpress
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Changing the owner of the Wordpress files&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chown -R www-data:www-data *
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;6. Databse details configure&lt;/strong&gt;&lt;br&gt;
Open &lt;code&gt;domain1.com&lt;/code&gt; and fill all the details.&lt;br&gt;
From next page copy it's contains and create new file with this in &lt;code&gt;/var/www/html/domain1.com&lt;/code&gt; folder&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano wp-config.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now complete remaining setup vi &lt;code&gt;domain1.com&lt;/code&gt; url&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>ubuntu</category>
      <category>linux</category>
      <category>nginx</category>
    </item>
    <item>
      <title>Oracle cloud EC2- Website not opening issue</title>
      <dc:creator>Partha Biswas</dc:creator>
      <pubDate>Wed, 25 Dec 2024 18:24:58 +0000</pubDate>
      <link>https://dev.to/partha7278/oracle-cloud-ec2-website-not-opening-issue-13gf</link>
      <guid>https://dev.to/partha7278/oracle-cloud-ec2-website-not-opening-issue-13gf</guid>
      <description>&lt;p&gt;&lt;strong&gt;Check Following things&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Do curl  request to understand webpage is accessible from local or not
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl localhost:80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Configure ingress route for port 80. Enable destination port 80 and source port all CIDRS &lt;code&gt;0.0.0.0/0&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Install Apache/nginx&lt;/li&gt;
&lt;li&gt;Disable ufw firewall - this may cause issues with the Oracle firewall&lt;/li&gt;
&lt;li&gt;use below command to enable via iptables
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT
sudo netfilter-persistent save
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;OR&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo iptables -A INPUT -p tcp --dport 3306 -j ACCEPT
sudo iptables-save &amp;gt; /etc/iptables/rules.v4
sudo iptables -L -n
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;test your web page over internet&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>oracle</category>
      <category>cloud</category>
      <category>webdev</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
