<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>https server Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/https-server/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Mon, 02 Jul 2018 08:07:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.13</generator>
	<item>
		<title>Install and Enjoy Caddy Web Server on Linux</title>
		<link>https://www.osradar.com/install-and-enjoy-caddy-web-server-on-linux/</link>
					<comments>https://www.osradar.com/install-and-enjoy-caddy-web-server-on-linux/#comments</comments>
		
		<dc:creator><![CDATA[osradar_editor]]></dc:creator>
		<pubDate>Sun, 01 Jul 2018 15:28:33 +0000</pubDate>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[caddy]]></category>
		<category><![CDATA[caddy server]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[https server]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=4568</guid>

					<description><![CDATA[<p>In the present world, security is the most important thing to keep an eye on. Even the slightest leakage can allow a huge tragedy to take place. In the case of websites, HTTPS is very important as without it, users are more likely to leak their sensitive info in the online. If you’re a webmaster, [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-and-enjoy-caddy-web-server-on-linux/">Install and Enjoy Caddy Web Server on Linux</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In the present world, security is the most important thing to keep an eye on. Even the slightest leakage can allow a huge tragedy to take place. In the case of websites, HTTPS is very important as without it, users are more likely to leak their sensitive info in the online. If you’re a webmaster, you may already be using NGINX or Apache. These are obviously very popular and powerful, but setting up HTTPS with them is a painful task.</p>
<p>Thanks to the world of devs, there’s another alternative solution to the problem – Caddy Web Server. It’s a really nice alternative to all those popular choices. It also comes with HTTPS by default, saving a lot of hassle and problem in the start.</p>
<p>Let’s take a look on installing Caddy in our system.</p>
<h2>Installing Caddy Web Server</h2>
<p>For installing Caddy in our Linux system, we’re going to use cURL. Caddy works the same on all the available platforms including all the normal Linux versions and server editions. It’s because Caddy loves to distribute their software with the help of a specialized bash script instead of adding software repo.</p>
<p>Run the following command:</p>
<pre>curl https://getcaddy.com | bash -s personal</pre>
<p><img loading="lazy" class="size-full wp-image-4571 aligncenter" src="https://www.osradar.com/wp-content/uploads/2018/07/caddy-install.png" alt="" width="1217" height="273" srcset="https://www.osradar.com/wp-content/uploads/2018/07/caddy-install.png 1217w, https://www.osradar.com/wp-content/uploads/2018/07/caddy-install-300x67.png 300w, https://www.osradar.com/wp-content/uploads/2018/07/caddy-install-768x172.png 768w, https://www.osradar.com/wp-content/uploads/2018/07/caddy-install-1024x230.png 1024w, https://www.osradar.com/wp-content/uploads/2018/07/caddy-install-696x156.png 696w, https://www.osradar.com/wp-content/uploads/2018/07/caddy-install-1068x240.png 1068w" sizes="(max-width: 1217px) 100vw, 1217px" /></p>
<p>In this demo, we’ll be running the Caddy “personal” (free) edition. It’s free of course, but for larger organizations and for higher usage, you should get the commercial edition. However, the commercial one is a bit costly. You can <a href="https://caddyserver.com/products/licenses">check out the commercial price plans here</a>.</p>
<p>If you want to install the commercial version of Caddy Web Server, run the following command:</p>
<pre>curl https://getcaddy.com | bash -s commercial</pre>
<p>After the script finishes downloading and installing Caddy, it&#8217;ll be installed in /usr/local/bin/ directory. Now, run the following command for modifying the Caddy binary.</p>
<pre>sudo setcap cap_net_bind_service=+ep /usr/local/bin/caddy</pre>
<h2><img loading="lazy" class="size-full wp-image-4572 aligncenter" src="https://www.osradar.com/wp-content/uploads/2018/07/caddy-binary-modify.png" alt="" width="1204" height="150" srcset="https://www.osradar.com/wp-content/uploads/2018/07/caddy-binary-modify.png 1204w, https://www.osradar.com/wp-content/uploads/2018/07/caddy-binary-modify-300x37.png 300w, https://www.osradar.com/wp-content/uploads/2018/07/caddy-binary-modify-768x96.png 768w, https://www.osradar.com/wp-content/uploads/2018/07/caddy-binary-modify-1024x128.png 1024w, https://www.osradar.com/wp-content/uploads/2018/07/caddy-binary-modify-696x87.png 696w, https://www.osradar.com/wp-content/uploads/2018/07/caddy-binary-modify-1068x133.png 1068w" sizes="(max-width: 1204px) 100vw, 1204px" /></h2>
<h2>Configuring Caddy</h2>
<p>Now, we have to configure the server. Let’s get going.</p>
<p>Enable root access:</p>
<pre>su

OR

sudo -s</pre>
<p>Create the directories where Caddy will operate:</p>
<pre>mkdir /etc/caddy
mkdir /etc/ssl/caddy
mkdir /var/www</pre>
<p>Note that if your server already contains &#8220;<strong>/var/www/&#8221; </strong>directory, you can skip the last command.</p>
<p><img loading="lazy" class="size-full wp-image-4573 aligncenter" src="https://www.osradar.com/wp-content/uploads/2018/07/caddy-make-dir.png" alt="" width="1212" height="212" srcset="https://www.osradar.com/wp-content/uploads/2018/07/caddy-make-dir.png 1212w, https://www.osradar.com/wp-content/uploads/2018/07/caddy-make-dir-300x52.png 300w, https://www.osradar.com/wp-content/uploads/2018/07/caddy-make-dir-768x134.png 768w, https://www.osradar.com/wp-content/uploads/2018/07/caddy-make-dir-1024x179.png 1024w, https://www.osradar.com/wp-content/uploads/2018/07/caddy-make-dir-696x122.png 696w, https://www.osradar.com/wp-content/uploads/2018/07/caddy-make-dir-1068x187.png 1068w" sizes="(max-width: 1212px) 100vw, 1212px" /></p>
<p>Now, create a new “Caddyfile”:</p>
<pre>touch /etc/caddy/Caddyfile</pre>
<p>Update the folder permission of the Caddy sub-folder:</p>
<pre>chmod 0770 /etc/ssl/caddy</pre>
<p>Now, chown the &#8220;/var/www&#8221; directory.</p>
<pre>chown www-data: /var/www</pre>
<p>For working properly with the “systemd”, run the following commands:</p>
<pre>touch /lib/systemd/system/caddy.service
nano /lib/systemd/system/caddy.service</pre>
<p>Paste the following code into the editor, then &#8220;Ctrl + O&#8221; to save the file and &#8220;Ctrl + X&#8221; to close the editor</p>
<pre>[Unit]
Description=Caddy HTTP/2 web server
Documentation=https://caddyserver.com/docs
After=network-online.target
Wants=network-online.target

[Service]
Restart=on-failure
StartLimitInterval=86400
StartLimitBurst=5

User=www-data
Group=www-data
; Letsencrypt-issued certificates will be written to this directory.
Environment=CADDYPATH=/etc/ssl/caddy

ExecStart=/usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/Caddyfile -root=/var/tmp
ExecReload=/bin/kill -USR1 $MAINPID

LimitNOFILE=1048576
LimitNPROC=64

PrivateTmp=true
PrivateDevices=true
ProtectHome=true
ProtectSystem=full
ReadWriteDirectories=/etc/ssl/caddy

; The following additional security directives only work with systemd v229 or later.
; They further retrict privileges that can be gained by caddy. Uncomment if you like.
; Note that you may have to add capabilities required by any plugins in use.
;CapabilityBoundingSet=CAP_NET_BIND_SERVICE
;AmbientCapabilities=CAP_NET_BIND_SERVICE
;NoNewPrivileges=true

[Install]
WantedBy=multi-user.target

</pre>
<p>Restart “caddy.service”:</p>
<pre>systemctl enable caddy.service
systemctl start caddy.service</pre>
<h2>Setting up domains</h2>
<p>Now, it’s just normal configuration like most other servers to perform some configurations. Let’s start with the domain folder.</p>
<p>Edit the “Caddyfile” for activating your new domain. Don&#8217;t forget to change the names with your domain name.</p>
<pre>mkdir -p /var/www/osradar.com/
nano /etc/caddy/Caddyfile

# Paste the following code for activating your domain on Caddy

domain-demo.com {
root /var/www/osradar.com
}</pre>
<p>Restart the “caddy.service”:</p>
<pre>systemctl restart caddy.service</pre>
<p>Enjoy Caddy! Check out <a href="https://www.osradar.com/install-and-configure-mariadb-server-on-centos-6-7-and-fedora-27-28/">installing MariaDB server on CentOS 6/7 and Fedora 27/28</a>.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-and-enjoy-caddy-web-server-on-linux/">Install and Enjoy Caddy Web Server on Linux</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/install-and-enjoy-caddy-web-server-on-linux/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
