Mostrando las entradas con la etiqueta Linux. Mostrar todas las entradas
Mostrando las entradas con la etiqueta Linux. Mostrar todas las entradas

martes, 3 de mayo de 2016

AUMENTAR TAMAÑO MAXIMO DE SUBIDA EN APACHE Y PHP

AUMENTAR TAMAÑO MAXIMO DE SUBIDA EN APACHE Y PHP


Una restricción lógica, pero molesta a veces, es el límite máximo en tamaño cuando deseamos cargar algún archivo a nuestro servidor web. Lo anterior se hace más notable si estamos desarrollando una aplicación web donde los usuarios requieran subir archivos (ya sea imágenes, documentos, paquetes comprimidos, etc) y éstos son más grandes que el límite estándar, el cual normalmente es de 2 MB.
Otro escenario: Si administras algún sitio basado en un CMS como  WordPressDrupal o Joomla, y quieres usar sus herramientas propias para subir archivos grandes, el resultado será un mensaje de error.
Aqui os dejo varias formas de solucionar esto:

Solución 1: Modificar php.ini global

La mejor solución de todas (desgraciadamente no todos pueden implementarla): modificar el archivo principal de configuración de PHP. Si tenemos un servidor local, o hemos contratado un servidor dedicado, es casi un hecho que podemos modificar el php.ini global, pero si tenemos un servidor compartido (sumamente comunes en la web), esta solución normalmente no es posible (algunos web hostings si lo permiten).
Dependiendo de tu distro, debemos editar el archivo php.ini con alguno de los siguientes comandos:
En ArchLinux:
$ sudo nano /etc/php/php.ini
En Ubuntu y Debian:
$ sudo nano /etc/php5/apache2/php.ini
En Fedora y CentOS:
$ sudo nano /etc/php.ini
Si estas familiarizado mas con otro editor que no sea nano, usa tu editor habitual, los mas comunes son vimnano, o gedit.
Dentro de php.ini, localiza el texto upload_max_filesize y asígnale un valor superior al que ya tiene, por ejemplo:
upload_max_filesize = 10M
También te recomiendo aumentar los valores de post_max_size(tamaño máximo de carga por envío, debe ser igual o mayor al especificado en upload_max_filesize), e incluso el de max_execution_time (tiempo máximo en segundos que el servidor esperará alscript para que termine su ejecución, en este caso, la carga de archivos). Por ejemplo:
upload_max_filesize = 10M
post_max_size = 20M
max_execution_time = 120
Guarda el archivo, y sal del editor. Para que los cambios aplicados funcionen, basta con reiniciar Apache.
En ArchLinux:
$ sudo /etc/rc.d/httpd restart
En Debian y Ubuntu:
$ sudo /etc/init.d/apache2 restart
En Fedora y CentOS:
$ sudo /etc/init.d/httpd restart

Solución 2: Usar php.ini local

Básicamente es hacer lo mismo que la solución anterior, la diferencia es que no se modifica el php.ini global, si no que creamos unphp.ini local. Este método tiene algunas limitantes:
  • Los efectos del php.ini local no son recursivos a los subdirectorios en donde se encuentre ubicado, así que no basta crearlo en el directorio raíz de nuestro servidor, si no que debemos especificar un php.ini en cada directorio donde queramos obtener el efecto deseado.
  • Puesto que cada php.ini local se toma en cuenta en vez del php.ini global, éstos deben incluir ciertas directivas de compatibilidad necesarias para el web hosting que tengas contratado, por lo que es necesario consultar a tu proveedor por dichas directivas.
Un ejemplo de php.ini local, con directivas de compatibilidad y las que nosotros necesitamos, sería:
zend_extension = /usr/local/ioncube/ioncube.so register_globals = Off magic_quotes_gpc = Off session.save_path = /tmp memory_limit = 200M upload_max_filesize = 10M post_max_size = 20M max_execution_time = 120
Pero repito, es muy importante consultar la documentación de tu proveedor de hosting.

Solución 3: Usar .htaccess

Crea (o modifica, en caso de que ya exista) el archivo .htaccess en el directorio raíz de tu sitio, blog o aplicación web, o bien, en el directorio donde deseas que las directivas tengan efecto.
Agrega las siguientes líneas (modifica los valores según lo requieras):
php_value upload_max_filesize 10M
php_value post_max_size 20M
php_value max_execution_time 120
A diferencia de la solución anterior, aquí no hay limitantes: los efectos del .htaccess si son recursivos a los subdirectorios donde se encuentre ubicado, y basta con especificar las directivas que nos interesan.

Nota:

En algunos ejemplos mencionados, he usado sudo, el motivo es porque como ya sabreis algunos son comandos que deben ejecutarse con permisos de administrador.  Si no tienes configurado tu usuario para utilizar sudo, entonces debes ejecutar dichos comandos como root.

Referencia:  http://lasegundapuerta.com/index.php/informatica/linux-y-software-libre/2120-aumentar-tamano-maximo-de-subida-en-apache-y-php

miércoles, 17 de febrero de 2016

SQL Error(2013) Lost Connection: reading initial communication packet

SQL Error(2013) Lost Connection: reading initial communication packet

lost connection to mysql server at reading initial communication packet system error 0

My solution was to change the "bind-address" IP in the MySQL config file "/etc/mysql/my.cnf". It was set to the local IP of the server instead of "127.0.0.1" :-)

# bind-address            = 127.0.0.1
bind-address            = 162.243.235.246

Mi solución fue cambiar el "bind-address" IP en el fichero de configuración de MySQL "/etc/mysql/my.cnf". Se establece en la IP local del servidor en lugar de "127.0.0.1" :-)

# bind-address            = 127.0.0.1
bind-address            = 162.243.235.246


http://www.heidisql.com/forum.php?t=10835

http://www.bramschoenmakers.nl/en/node/595.html

sábado, 29 de agosto de 2015

Server Stop, Start, Restart (Apache, SSH, MySql)

Server Stop, Start, Restart (Apache, SSH, MySql)

Apache:
Q. I’m using CentOS / RHEL / Fedora Linux server and I’d like to restart my httpd server after making some changes to httpd.conf file. How do I restart httpd?
A. You can use service command to restart httpd. Another option is use /etc/init.d/httpd service script.
Login as root user and type the following commands:

Task: Start httpd server:

# service httpd start

Task: Restart httpd server:

# service httpd restart

Task: Stop httpd server:

# service httpd stop
Please note that restart option is a shorthand way of stopping and then starting the Apache HTTPd Server. You need to restart server whenever you make changes to httpd.conf file. It is also good idea to check configuration error before typing restart option:
# httpd -t
# httpd -t -D DUMP_VHOSTS

Sample output:
Syntax OK
Now restart httpd server:
# service httpd restart
Where,
  • -t : Run syntax check for config files
  • -t -D DUMP_VHOSTS : Run syntax check for config files and show parsed settings only for vhost.

/etc/init.d/httpd script

You can also use following command:
# /etc/init.d/httpd restart
# /etc/init.d/httpd start
# /etc/init.d/httpd stop

A note about Debian / Ubuntu Linux

Type the following command under Debian / Ubuntu Linux:
# /etc/init.d/apache2 restart
# /etc/init.d/apache2 stop
# /etc/init.d/apache2 start

You can also use service command under Debian / Ubuntu Linux:
# service apache2 restart
# service apache2 stop
# service apache2 start

SSH:

Q. How do I monitor my ssh server with monit? How do I restart ssh server if it does not respond or dead due to any issues under Linux?
A. You can easily monitor Linux server or service such as OpenSSH (SSHD daemon) using monit utility.

Monitor SSH and Auto Restart If Died

Open your /etc/monitrc or /etc/monit/monitrc file:
# vi /etc/monit/monitrc
Append following code:
check process sshd with pidfile /var/run/sshd.pid
start program "/etc/init.d/ssh start"
stop program "/etc/init.d/ssh stop"
if failed port 22 protocol ssh then restart
if 5 restarts within 5 cycles then timeout

Save and close the file. Make sure you set /var/run/sshd.pid and /etc/init.d/ssh as per your Linux distribution. These values are valid for Debian / Ubuntu Linux. Restart monit to pickup the changes:
# /etc/init.d/monit restart

Mysql:

Each distribution comes with a shell script (read as service) to restart / stop / start MySQL server. First login as root user and open shell prompt (command prompt).
First login as root user. Now type the following command as per your Linux distro:

A) If you are using mysql on RedHat Linux (Fedora Core/Cent OS) then use following command:

* To start mysql server:
/etc/init.d/mysqld start
* To stop mysql server:
/etc/init.d/mysqld stop
* To restart mysql server
 /etc/init.d/mysqld restart
Tip: Redhat Linux also supports service command, which can be use to start, restart, stop any service:
# service mysqld start
# service mysqld stop
# service mysqld restart

(B) If you are using mysql on Debian / Ubuntu Linux then use following command:

* To start mysql server:
/etc/init.d/mysql start
* To stop mysql server:
/etc/init.d/mysql stop
* To restart mysql server
/etc/init.d/mysql restart

viernes, 3 de julio de 2015

Check and open ports in CentOS / Fedora / Redhat

 Check and open ports in CentOS / Fedora / Redhat
If you want to open or close a port for a Linux firewall you have to edit the rules in the iptables configuration. By default iptables firewall stores its configuration at /etc/sysconfig/iptables file. You need to edit this file and add rules to open port.
Here are the steps to open the port XY using the default visual editor vi:
Open port XY
Open flle /etc/sysconfig/iptables:
# vi /etc/sysconfig/iptables
Append rule as follows:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport XY -j ACCEPT

Save and close the file. Restart iptables:
# /etc/init.d/iptables restart
Verify that port is open
Run following command:
# netstat -tulpn | less
Make sure iptables is allowing port connections:
# iptables -L -n

For more information visit:

lunes, 8 de junio de 2015

Install NodeJS and NPM in Linux Mint 17 or Ubuntu 14.04

Install NodeJS and NPM in Linux Mint 17 or Ubuntu 14.04

There are some problems compiling the NodeJS sources in Linux, here is an easy way to install NodeJS and NPM using the chris-lea repository.
Just write these commands using a terminal window.
First, we must uninstall any previous nodejs version and npm.
sudo apt-get remove nodejs nodejs-dev npm
Now we add the chris-lea repository.
sudo add-apt-repository ppa:chris-lea/node.js 
sudo apt-get update
sudo apt-get install nodejs

We can test if everything is ok checking the nodejs version.
nodejs -v
npm -v
For previous Linux versions could be possible to install npm as an aditional package.


Otra Forma

domingo, 29 de marzo de 2015

Instalar composer de forma global en linux



Instalar composer, con composer podremos instalar todas las dependencias necesarias para tener un proyecto, con dependencias php entre otros

forma Sencilla :
1) Ir al sitio Oficial https://getcomposer.org/download/
2) copiar y pega en el termial(Console)
   curl -sS https://getcomposer.org/installer | php

3) sudo mv composer.phar /usr/local/bin/composer

Listo tiene composer instaldo de forma global.

Ejemplo de utilizacion de composer 
crear un archivo: composer.json

{
"name": "sileence/composer-example",
"description": "Ejemplo de uso Composer",
"type": "project",
"authors":[
{
"name":"Armando Enrique Pisfil Puemape",
"email": "armandoaepp@gmail.com",
"homepage":"http://armandoaepp.blogspot.com",
"role":"development"
}
],
"require":{
"php": ">=5.3.0"
},
"autoload":{
"psr-4" : {

}
}

}

- Instalar de esta forma para probar: composer install



En linux podemos instalar composer con curl con el siguiente comando ...

curl -sS https://getcomposer.org/installer | php
De no tener instalado curl también lo podemos hacer a través de php con el siguiente comando ...

php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));" 
Ahora para ver las distintas opciones que te ofrece composer puedes ejecutar el siguiente comando, para ello tendrás que encontrarte en la misma ruta donde se encuentra el archivo composer.phar ...

php composer.phar 
Lo suyo es poder ejecutar composer globalmente, para ello tendrás que renombrar el archivo 'composer.phar' a 'composer', es decir, sin extensión y moverlo a la ruta /usr/local/bin
sudo mv composer.phar /usr/local/bin/composer )
, ahora si puedes ejecutarlo simplemente incluyendo el siguiente comando ...

composer 

Para instalarlo en Windows vamos a necesitar el ejecutable que nos proporcionan en la web oficial de composer haciendo click en el siguiente enlace ... Descargar composer para Windows

Se puede dar el caso de que obtengas un error al instalarlo, de ser así, puedes ver el siguiente post para solucionar el problema ... Solucionar problema al instalar composer en Windows.

Pagina oficial

https://getcomposer.org/download/

lunes, 23 de marzo de 2015

How To Set Up Apache Virtual Hosts on CentOS 7

How To Set Up Apache Virtual Hosts on CentOS 7


Introduction

The Apache web server is the most popular way of serving web content on the Internet. It serves more than half of all of the Internet's active websites, and is extremely powerful and flexible.
Apache breaks down its functionality and components into individual units that can be customized and configured independently. The basic unit that describes an individual site or domain is called a virtual host. Virtual hosts allow one server to host multiple domains or interfaces by using a matching system. This is relevant to anyone looking to host more than one site off of a single VPS.
Each domain that is configured will direct the visitor to a specific directory holding that site's information, without ever indicating that the same server is also responsible for other sites. This scheme is expandable without any software limit, as long as your server can handle the traffic that all of the sites attract.
In this guide, we will walk through how to set up Apache virtual hosts on a CentOS 7 VPS. During this process, you'll learn how to serve different content to different visitors depending on which domains they are requesting.

Prerequisites

Before you begin with this guide, there are a few steps that need to be completed first.
You will need access to a CentOS 7 server with a non-root user that has sudo privileges. If you haven't configured this yet, you can run through the CentOS 7 initial server setup guide to create this account.
You will also need to have Apache installed in order to configure virtual hosts for it. If you haven't already done so, you can use yum to install Apache through CentOS's default software repositories:
sudo yum -y install httpd
Next, enable Apache as a CentOS service so that it will automatically start after a reboot:
sudo systemctl enable httpd.service
After these steps are complete, log in as your non-root user account through SSH and continue with the tutorial.
Note: The example configuration in this guide will make one virtual host for example.com and another for example2.com. These will be referenced throughout the guide, but you should substitute your own domains or values while following along. To learn how to set up your domain names with DigitalOcean, follow this link.
If you do not have any real domains to play with, we will show you how to test your virtual host configuration with dummy values near the end of the tutorial.

Step One — Create the Directory Structure

First, we need to make a directory structure that will hold the site data to serve to visitors.
Our document root (the top-level directory that Apache looks at to find content to serve) will be set to individual directories in the /var/www directory. We will create a directory here for each of the virtual hosts that we plan on making.
Within each of these directories, we will create a public_html directory that will hold our actual files. This gives us some flexibility in our hosting.
We can make these directories using the mkdir command (with a -p flag that allows us to create a folder with a nested folder inside of it):
sudo mkdir -p /var/www/example.com/public_html
sudo mkdir -p /var/www/example2.com/public_html
Remember that the portions in red represent the domain names that we want to serve from our VPS.

Step Two — Grant Permissions

We now have the directory structure for our files, but they are owned by our root user. If we want our regular user to be able to modify files in our web directories, we can change the ownership with chown:
sudo chown -R $USER:$USER /var/www/example.com/public_html
sudo chown -R $USER:$USER /var/www/example2.com/public_html
The $USER variable will take the value of the user you are currently logged in as when you submit the command. By doing this, our regular user now owns the public_html subdirectories where we will be storing our content.
We should also modify our permissions a little bit to ensure that read access is permitted to the general web directory, and all of the files and folders inside, so that pages can be served correctly:
sudo chmod -R 755 /var/www
Your web server should now have the permissions it needs to serve content, and your user should be able to create content within the appropriate folders.

Step Three — Create Demo Pages for Each Virtual Host

Now that we have our directory structure in place, let's create some content to serve.
Because this is just for demonstration and testing, our pages will be very simple. We are just going to make an index.html page for each site that identifies that specific domain.
Let's start with example.com. We can open up an index.html file in our editor by typing:
nano /var/www/example.com/public_html/index.html
In this file, create a simple HTML document that indicates the site that the page is connected to. For this guide, the file for our first domain will look like this:
<html>
  <head>
    <title>Welcome to Example.com!</title>
  </head>
  <body>
    <h1>Success! The example.com virtual host is working!</h1>
  </body>
</html>
Save and close the file when you are finished.
We can copy this file to use as the template for our second site's index.html by typing:
cp /var/www/example.com/public_html/index.html /var/www/example2.com/public_html/index.html
Now let's open that file and modify the relevant pieces of information:
nano /var/www/example2.com/public_html/index.html
<html>
  <head>
    <title>Welcome to Example2.com!</title>
  </head>
  <body>
    <h1>Success! The example2.com virtual host is working!</h1>
  </body>
</html>
Save and close this file as well. You now have the pages necessary to test the virtual host configuration.

Step Four — Create New Virtual Host Files

Virtual host files are what specify the configuration of our separate sites and dictate how the Apache web server will respond to various domain requests.
To begin, we will need to set up the directory that our virtual hosts will be stored in, as well as the directory that tells Apache that a virtual host is ready to serve to visitors. The sites-available directory will keep all of our virtual host files, while the sites-enabled directory will hold symbolic links to virtual hosts that we want to publish. We can make both directories by typing:
sudo mkdir /etc/httpd/sites-available
sudo mkdir /etc/httpd/sites-enabled
Note: This directory layout was introduced by Debian contributors, but we are including it here for added flexibility with managing our virtual hosts (as it's easier to temporarily enable and disable virtual hosts this way).
Next, we should tell Apache to look for virtual hosts in the sites-enabled directory. To accomplish this, we will edit Apache's main configuration file and add a line declaring an optional directory for additional configuration files:
sudo nano /etc/httpd/conf/httpd.conf
Add this line to the end of the file:
IncludeOptional sites-enabled/*.conf
Save and close the file when you are done adding that line. We are now ready to create our first virtual host file.

Create the First Virtual Host File

Start by opening the new file in your editor with root privileges:
sudo nano /etc/httpd/sites-available/example.com.conf
Note: Due to the configurations that we have outlined, all virtual host files must end in .conf.
First, start by making a pair of tags designating the content as a virtual host that is listening on port 80 (the default HTTP port):
<VirtualHost *:80>

</VirtualHost>
Next we'll declare the main server name, www.example.com. We'll also make a server alias to point toexample.com, so that requests for www.example.com and example.com deliver the same content:
<VirtualHost *:80>
    ServerName www.example.com
    ServerAlias example.com
</VirtualHost>
Note: In order for the www version of the domain to work correctly, the domain's DNS configuration will need an A record or CNAME that points www requests to the server's IP. A wildcard (*) record will also work. To learn more about DNS records, check out our host name setup guide.
Finally, we'll finish up by pointing to the root directory of our publicly accessible web documents. We will also tell Apache where to store error and request logs for this particular site:
<VirtualHost *:80>

    ServerName www.example.com
    ServerAlias example.com
    DocumentRoot /var/www/example.com/public_html
    ErrorLog /var/www/example.com/error.log
    CustomLog /var/www/example.com/requests.log combined
</VirtualHost>
When you are finished writing out these items, you can save and close the file.

Copy First Virtual Host and Customize for Additional Domains

Now that we have our first virtual host file established, we can create our second one by copying that file and adjusting it as needed.
Start by copying it with cp:
sudo cp /etc/httpd/sites-available/example.com.conf /etc/httpd/sites-available/example2.com.conf
Open the new file with root privileges in your text editor:
sudo nano /etc/httpd/sites-available/example2.com.conf
You now need to modify all of the pieces of information to reference your second domain. When you are finished, your second virtual host file may look something like this:
<VirtualHost *:80>
    ServerName www.example2.com
    DocumentRoot /var/www/example2.com/public_html
    ServerAlias example2.com
    ErrorLog /var/www/example2.com/error.log
    CustomLog /var/www/example2.com/requests.log combined
</VirtualHost>
When you are finished making these changes, you can save and close the file.

Step Five — Enable the New Virtual Host Files

Now that we have created our virtual host files, we need to enable them so that Apache knows to serve them to visitors. To do this, we can create a symbolic link for each virtual host in the sites-enableddirectory:
sudo ln -s /etc/httpd/sites-available/example.com.conf /etc/httpd/sites-enabled/example.com.conf
sudo ln -s /etc/httpd/sites-available/example2.com.conf /etc/httpd/sites-enabled/example2.com.conf
When you are finished, restart Apache to make these changes take effect:
sudo apachectl restart

Step Six — Set Up Local Hosts File (Optional)

If you have been using example domains instead of actual domains to test this procedure, you can still test the functionality of your virtual hosts by temporarily modifying the hosts file on your local computer. This will intercept any requests for the domains that you configured and point them to your VPS server, just as the DNS system would do if you were using registered domains. This will only work from your computer, though, and is simply useful for testing purposes.
Note: Make sure that you are operating on your local computer for these steps and not your VPS server. You will need access to the administrative credentials for that computer.
If you are on a Mac or Linux computer, edit your local hosts file with administrative privileges by typing:
sudo nano /etc/hosts
If you are on a Windows machine, you can find instructions on altering your hosts file here.
The details that you need to add are the public IP address of your VPS followed by the domain that you want to use to reach that VPS:
127.0.0.1   localhost
127.0.1.1   guest-desktop
server_ip_address example.com
server_ip_address example2.com
This will direct any requests for example.com and example2.com on our local computer and send them to our server at server_ip_address.

Step Seven — Test Your Results

Now that you have your virtual hosts configured, you can test your setup easily by going to the domains that you configured in your web browser:
http://example.com
You should see a page that looks like this:
Success! The example.com virtual host is working!
Likewise, if you visit your other domains, you will see the files that you created for them.
If all of the sites that you configured work well, then you have successfully configured your new Apache virtual hosts on the same CentOS server.
If you adjusted your home computer's hosts file, you may want to delete the lines that you added now that you've verified that your configuration works. This will prevent your hosts file from being filled with entries that are not actually necessary.

Conclusion

At this point, you should now have a single CentOS 7 server handling multiple sites with separate domains. You can expand this process by following the steps we outlined above to make additional virtual hosts later. There is no software limit on the number of domain names Apache can handle, so feel free to make as many as your server is capable of handling.

referencia : https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-centos-7

domingo, 22 de marzo de 2015

Arrancar / Parar / Reiniciar servicios en RHEL 7 y CentOS 7


En RHEL 7 y CentOS 7 (ver guía de instalación)la forma de controlar los servicios del sistema cambia completamente. Pasamos del uso del comando “service” y de la control de servicios a través de “/etc/init.d” a la gestión a través del service manager systemctl.
La explicación la tenemos directamente en el fichero README de /etc/init.d:
# more /etc/init.d/README 
You are looking for the traditional init scripts in /etc/rc.d/init.d,
and they are gone?

Here's an explanation on what's going on:

You are running a systemd-based OS where traditional init scripts have
been replaced by native systemd services files. Service files provide
very similar functionality to init scripts. To make use of service
files simply invoke "systemctl", which will output a list of all
currently running services (and other units). Use "systemctl
list-unit-files" to get a listing of all known unit files, including
stopped, disabled and masked ones. Use "systemctl start
foobar.service" and "systemctl stop foobar.service" to start or stop a
service, respectively. For further details, please refer to
systemctl(1).

Note that traditional init scripts continue to function on a systemd
system. An init script /etc/rc.d/init.d/foobar is implicitly mapped
into a service unit foobar.service during system initialization.

Thank you!

Further reading:
        man:systemctl(1)
        man:systemd(1)

http://0pointer.de/blog/projects/systemd-for-admins-3.html


http://www.freedesktop.org/wiki/Software/systemd/Incompatibilities

Vamos a ver entonces los comandos básicos de gestión de servicios con systemctl.

Listar servicios del sistema

El comando systemctl sin parámetros nos mostrará el listado de todos los servicios del sistema, incluyendo los que están activos, parados o en estado fallido.
# systemctl 
UNIT                                                LOAD   ACTIVE SUB       DESCRIPTION
proc-sys-fs-binfmt_misc.automount                   loaded active waiting   Arbitrary Executable File Formats File System Automo
sys-devices-pci0...et1:0:0-1:0:0:0-block-sr0.device loaded active plugged   VBOX_CD-ROM
sys-devices-pci0...0-0000:00:03.0-net-enp0s3.device loaded active plugged   PRO/1000 MT Desktop Adapter
sys-devices-pci0...-0000:00:05.0-sound-card0.device loaded active plugged   82801AA AC'97 Audio Controller
sys-devices-pci0...:0-2:0:0:0-block-sda-sda1.device loaded active plugged   VBOX_HARDDISK
sys-devices-pci0...:0-2:0:0:0-block-sda-sda2.device loaded active plugged   LVM PV F3zoLx-uSaP-faJK-Vhz7-iJC4-XFml-QjX37E on /de
sys-devices-pci0...et2:0:0-2:0:0:0-block-sda.device loaded active plugged   VBOX_HARDDISK
Los servicios son llamados UNITS, y como veis podemos visualizar el estado del proceso, si está cargado en el sistema, descripción…
El parámetro list-units muestra la misma información:
# systemctl list-units

Ver estado de un servicio

Tan sencillo como pasar el parámetro status + el servicio. Vamos a ver el estado del firewall:
# systemctl status firewalld.service
firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
   Active: active (running) since sáb 2014-08-23 17:51:42 CEST; 9min ago
 Main PID: 549 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─549 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

ago 23 17:51:42 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
Como podéis observar nos ofrece mucha más información que el típico status que teníamos en “init.d” y “service”. Incluso podemos ver el log completo o sólo la parte que engloba el arranque:
# systemctl status network.service
network.service - LSB: Bring up/down networking
   Loaded: loaded (/etc/rc.d/init.d/network)
   Active: active (exited) since sáb 2014-08-23 17:51:45 CEST; 10min ago
  Process: 830 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=0/SUCCESS)

ago 23 17:51:43 localhost.localdomain systemd[1]: Starting LSB: Bring up/down networking...
ago 23 17:51:44 localhost.localdomain network[830]: Bringing up loopback interface:  Could not load file '/etc/sysconfig...g-lo'
ago 23 17:51:44 localhost.localdomain network[830]: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'
ago 23 17:51:44 localhost.localdomain network[830]: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'
ago 23 17:51:44 localhost.localdomain network[830]: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'
ago 23 17:51:44 localhost.localdomain network[830]: [  OK  ]
ago 23 17:51:45 localhost.localdomain network[830]: Bringing up interface enp0s3:  [  OK  ]
ago 23 17:51:45 localhost.localdomain systemd[1]: Started LSB: Bring up/down networking.
Hint: Some lines were ellipsized, use -l to show in full.

Arrancar, parar y reiniciar servicios

Ya sabemos los servicios que hay en el sistema, así que podemos invocarlos para iniciarlos, pararlos o reiniciarlos:
Iniciar servicio:
# systemctl start firewalld.service
Parar servicio:
# systemctl stop firewalld.service
Reiniciar servicio:
# systemctl restart firewalld.service
Recargar servicio (si lo permite):
# systemctl reload firewalld.service

chkconfig vs systemctl

Esto lo quiero explicar más detenidamente en otro artículo, pero sólo añadir que chkconfig también es sustituido por systemctl.
Por ejemplo, para quitar la red del arranque:
[root@localhost ~]# systemctl disable NetworkManager.service
rm '/etc/systemd/system/multi-user.target.wants/NetworkManager.service'
rm '/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service'
rm '/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service'
Y vemos que al lanzar un status aparece el servicio activo pero “disabled” en el arranque:
[root@localhost ~]# systemctl status NetworkManager.service
NetworkManager.service - Network Manager
   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; disabled)
   Active: active (running) since sáb 2014-08-23 17:51:43 CEST; 15min ago
 Main PID: 676 (NetworkManager)
Si lo volvemos a configurar:
[root@localhost ~]# systemctl enable NetworkManager.service
ln -s '/usr/lib/systemd/system/NetworkManager.service' '/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service'
ln -s '/usr/lib/systemd/system/NetworkManager.service' '/etc/systemd/system/multi-user.target.wants/NetworkManager.service'
ln -s '/usr/lib/systemd/system/NetworkManager-dispatcher.service' '/etc/systemd/system
/dbus-org.freedesktop.nm-dispatcher.service'
[root@localhost ~]# systemctl status NetworkManager.service
NetworkManager.service - Network Manager
   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled)
   Active: active (running) since sáb 2014-08-23 17:51:43 CEST; 16min ago
Esto es lo que tenéis que saber para iniciaros con systemctl. Recordad que la página man del comando tiene toda la información necesaria para administración avanzada. En algún otro artículo iré poniendo más funcionalidades interesantes (que no son pocas).