Difference between revisions of "This Is Your Brain On Informatics: Common Pathnames"

From Pathology Education Instructional Resource
Jump to: navigation, search
 
(10 intermediate revisions by one user not shown)
Line 1: Line 1:
===/etc/init.d/[service] [operation]===
+
===Restarting, reloading, etc. a Service===
 +
<pre>/etc/init.d/[service] [operation]</pre>
  
<p>This "pathname" is actually a script that causes the initiate daemon (that constantly stays in memory) to act on a service that has been input.  After the service, an operation can be input in from one of the following: </p>
+
''Services''
 +
* nginx
 +
* mysql
 +
* php5-fpm
 +
* denyhosts
  
 +
''Operations''
 
* start
 
* start
 
* stop
 
* stop
Line 9: Line 15:
 
* force-reload
 
* force-reload
  
<p>
+
===Network File===
For our purposes, the only services that we know that this script can act on are as follows: 
+
<pre>/etc/network/interfaces</pre>
</p>
+
  
* nginx
+
===Important [[This Is Your Brain On Informatics: DenyHosts|Deny Hosts]] Files===
* mysql
+
The hosts.deny file is for blocking IP addresses.
* php5-fpm
+
* denyhosts
+
  
===/etc/network/interfaces===
+
<pre>/etc/hosts.deny</pre>
  
<p>
+
The hosts.allow file is for permanently giving access to IP addresses.
This file will allow modification of the networks that are on a computer/server. It can be used to set up a static IP address, but a virtual machine will need to use a dynamically acquired IP.  This network will be necessary for allowing the machine to allow ssh capabilities.  Below are the steps for setting up a second network on a virtual machine (one more is necessary in addition to the one that is already on the machine).
+
  
# Access the above pathname with pico ( pic /etc/network/interfaces)
+
<pre>/etc/host.allow</pre>
# Below the first network (indicated by eth0), copy the first network, replacing eth0 with eth1
+
#::::auto eth1
+
#::::iface eth1 inet dhcp
+
# Reboot the machine
+
# Determine the new IP address of the eth1 network by one of the following
+
## After logging in, check the IP next to the eth1 network
+
## Type "ifconfig" into the command line and check the IP next to the "inet addr:"
+
</p>
+
  
===/etc/hosts.deny===
 
  
<p>
+
{{This Is Your Brain On Informatics}}
This file can be accessed via [[This Is Your Brain On Informatics: Pico|pico]] or any other text editor in order to manage the IP addresses that have been blocked from accessing your virtual machine (including your own if it accidentally happens).  Once you are in the file, delete the IP address (possibly your IP address) at the bottom of the file that you no longer wish to restrict.
+
</p>
+
  
===/etc/host.allow===
+
[[Category:This Is Your Brain On Informatics]]
 
+
<p>
+
This is a file that is similar in nature to the hosts.deny file in that IP addresses can be input into the file.  However, IP addresses that are input into this file will be allowed access to the nginx web server and prevented from being automatically added to the hosts.deny file (this will still occur if the login attempts from the same IP address are exceeded).  This file should only be used as a last resort if denyhosts continually (and erroneously) adds your personal IP address to the hosts.deny file.  An alternative is using [[This Is Your Brain On Informatics: Linux|aptitude]] to remove the denyhosts firewall; however, this is not recommended for a live server.
+
</p>
+
 
+
{{This Is Your Brain On Informatics}}
+

Latest revision as of 20:29, 18 March 2014

Restarting, reloading, etc. a Service

/etc/init.d/[service] [operation]

Services

  • nginx
  • mysql
  • php5-fpm
  • denyhosts

Operations

  • start
  • stop
  • reload
  • restart
  • force-reload

Network File

/etc/network/interfaces

Important Deny Hosts Files

The hosts.deny file is for blocking IP addresses.

/etc/hosts.deny

The hosts.allow file is for permanently giving access to IP addresses.

/etc/host.allow