Black log

Etiquetados como ‘plesk’

Parallels planea incluir esta funcionalidad en un futuro, mientras tanto es posible realizar esta operación desde línea de comandos.

/usr/sbin/useradd -d $HTTPD_VHOSTS_D/your_domain/some/location -s /bin/false USER_NAME
passwd USER_NAME
/usr/sbin/usermod -G psacln USER_NAME
chmod 755 $HTTPD_VHOSTS_D/your_domain/some/location
chown USER_NAME:psacln $HTTPD_VHOSTS_D/your_domain/some/location
chmod 751 $HTTPD_VHOSTS_D/your_domain/httpdocs

Nota: Para poder llevar a cabo está operación es necesario acceder al sistema con una cuenta con privilegios

1 comentario | Archivado como General | 22/07/2010

Habilitar subdominios wildcard con Plesk

Escrito por Sergio Sainz el 07-05-2010

Este artículo explica como hacer que todos los subdominios apunten a un dominio.

En primer lugar hay que añadir un registro en la zona DNS del tipo:


*.dominio.com.   CNAME   dominio.com

Luego, dentro del directorio /conf creamos o editamos el archivo vhost.conf


ServerAlias *.dominio.com

Por último se ejecuta el siguiente comando para aplicar los cambios:


/usr/local/psa/admin/bin/websrvmng -av

2 comentarios | Archivado como Sistemas TI | 07/05/2010

ASP.NET con IIS 7.5 y Plesk 9.3

Escrito por Sergio Sainz el 03-04-2010

Hemos detectado el siguiente problema tras instalar Plesk 9.3 sobre Windows Server 2008 R2.


 Server Error in '/mssql' Application.
 --------------------------------------------------------------------------------

 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
 Description: An unhandled exception occurred during the execution of
 the current web request. Please review the stack trace for more
 information about the error and where it originated in the code.

 Exception Details: System.UnauthorizedAccessException: Access is
 denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

 ASP.NET is not authorized to access the requested resource. Consider
 granting access rights to the resource to the ASP.NET request
 identity. ASP.NET has a base process identity (typically
 {MACHINE}ASPNET on IIS 5 or Network Service on IIS 6) that is used if
 the application is not impersonating. If the application is
 impersonating via , the identity will be
 the anonymous user (typically IUSR_MACHINENAME) or the authenticated
 request user.

 To grant ASP.NET access to a file, right-click the file in Explorer,
 choose "Properties" and select the Security tab. Click "Add" to add
 the appropriate user or group. Highlight the ASP.NET account, and
 check the boxes for the desired access.

 Source Error:

 An unhandled exception was generated during the execution of the
 current web request. Information regarding the origin and location of
 the exception can be identified using the exception stack trace below.

 Stack Trace:

 [UnauthorizedAccessException: Access is denied. (Exception from
 HRESULT: 0x80070005 (E_ACCESSDENIED))]

 [FileLoadException: Could not load file or assembly
 'System.ServiceModel, Version=3.0.0.0, Culture=neutral,
 PublicKeyToken=b77a5c561934e089' or one of its dependencies. Access is
 denied.]
 System.Reflection.Assembly._nLoad(AssemblyName fileName, String
 codeBase, Evidence assemblySecurity, Assembly locationHint,
 StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean
 forIntrospection) +0
 System.Reflection.Assembly.nLoad(AssemblyName fileName, String
 codeBase, Evidence assemblySecurity, Assembly locationHint,
 StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean
 forIntrospection) +43
 System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
 Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
 forIntrospection) +127
 System.Reflection.Assembly.InternalLoad(String assemblyString,
 Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
 forIntrospection) +142
 System.Reflection.Assembly.Load(String assemblyString) +28

 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
 assemblyName, Boolean starDirective) +46

 [ConfigurationErrorsException: Could not load file or assembly
 'System.ServiceModel, Version=3.0.0.0, Culture=neutral,
 PublicKeyToken=b77a5c561934e089' or one of its dependencies. Access is
 denied.]

 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
 assemblyName, Boolean starDirective) +613

 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo
 ai) +57

 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection
 compConfig) +178
 System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath
 configPath, Boolean supportLocalization, String outputAssemblyName) +54

 System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean  isPrecompiledApp)
 +232
 System.Web.Compilation.BuildManager.CompileGlobalAsax() +51
 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()  +337

 [HttpException (0x80004005): Could not load file or assembly
 'System.ServiceModel, Version=3.0.0.0, Culture=neutral,
 PublicKeyToken=b77a5c561934e089' or one of its dependencies. Access is
 denied.]

 System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()
 +58
 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()  +512

 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
 appManager, IApplicationHost appHost, IConfigMapPathFactory
 configMapPathFactory, HostingEnvironmentParameters hostingParameters)
 +729

 [HttpException (0x80004005): Could not load file or assembly
 'System.ServiceModel, Version=3.0.0.0, Culture=neutral,
 PublicKeyToken=b77a5c561934e089' or one of its dependencies. Access is
 denied.]
 System.Web.HttpRuntime.FirstRequestInit(HttpContext context)  +8897659
 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)  +85

 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest  wr,
 HttpContext context) +333

El error se podía reproducir al tratar de ejecutar una aplicación ASP.NET desde Plesk, en nuestro caso al lanzar el administrador web para bases de datos SQL Server ASP.NET Enterprise Manager o MyLittleAdmin que se ejecutan desde Plesk.

Si tratamos de corregir el error desde la herramienta Plesk Reconfigurator no solucionaremos el problema debido a que los permisos necesarios no estan añadidos. Por ello, tendremos que hacerlo a mano.

Lo único que tenemos que hacer es editar el archivo DiskSecurity.xml que encontraremos en la carpeta %PLESK_DIR%etcDiskSecurity y añadirle el siguiente contenido dentro del tag Entries:


<!-- Permisos a Assembly para ASP.NET Enterprise manager -->

<Entry AccounType="1" Account="Psacln" Path="C:Windowsassembly" AceFlags="FilesOnly" AccessMask="Read" EntryFlags="0x0" />

Finalmente hay que ejecutar el siguiente comando para que se apliquen los cambios en los permisos:


"%plesk_bin%applysecurity" --apply

Sin comentarios | Archivado como General | 03/04/2010

Puede resultar muy útil para saber dónde está cada cosa y conocer las distintas variables de Plesk. Sobre todo, si gestionais diferentes entornos y no es posible una configuración homogénea entre ellos.


# cat /etc/psa/psa.conf

#
# (c) Copyright 1999-2008 Parallels
# All Rights Reserved
#
# This file is used to declare the location of different utilities,
# services, and/or packages within Plesk.  No changes should be made
# to this file without first consulting support. Any changes made can
# affect service availability and performance.
#
# Each line in this file follows the following format:
#
# variable [whitespace characters] value
#
# That is, the name of the field, followed by spaces or tabs, followed
# by field value. Trailing spaces are removed.
#

# Plesk tree
PRODUCT_ROOT_D /usr/local/psa

# Directory of SysV-like Plesk initscripts
PRODUCT_RC_D /etc/init.d

# Directory for config files
PRODUCT_ETC_D /usr/local/psa/etc

# Directory for service utilities
PLESK_LIBEXEC_DIR /usr/lib64/plesk-9.0

# Virtual hosts directory
HTTPD_VHOSTS_D /srv/www/vhosts

# Apache configuration files directory
HTTPD_CONF_D /etc/apache2

# Apache include files directory
HTTPD_INCLUDE_D /etc/apache2/conf.d

# Apache binary files directory
HTTPD_BIN_D /usr/bin

#Apache log files directory
HTTPD_LOG_D /var/log/apache2

#apache startup script
HTTPD_SERVICE apache2

# Qmail directory
QMAIL_ROOT_D /var/qmail

# Location of qmail maildirs
PLESK_MAILNAMES_D /var/qmail/mailnames

# Path to rblsmtpd
RBLSMTPD /usr/sbin/rblsmtpd

# Courier-IMAP
COURIER_IMAP_ROOT_D /

# Proftpd
FTPD_CONF /etc/proftpd.conf
FTPD_CONF_INC /etc/proftpd.include
FTPD_BIN_D /usr/bin
FTPD_VAR_D /var/run/proftpd
FTPD_SCOREBOARD /var/run/proftpd/scoreboard

# Bind
NAMED_RUN_ROOT_D /var/lib/named
NAMED_OPTIONS_CONF /etc/named.conf.include.plesk-options
NAMED_ZONES_CONF /etc/named.conf.include.plesk-zones

# Webalizer
WEB_STAT /usr/bin/webalizer

# Logrotate
LOGROTATE /usr/local/psa/logrotate/sbin/logrotate

# MySQL
MYSQL_VAR_D /var/lib/mysql
MYSQL_BIN_D /usr/bin

# PostgreSQL
PGSQL_DATA_D /var/lib/pgsql/data
PGSQL_BIN_D /usr/bin

# Backups directory
DUMP_D /var/lib/psa/dumps

# Mailman directories
MAILMAN_ROOT_D /usr/lib/mailman
MAILMAN_VAR_D /var/lib/mailman

# Python binary
PYTHON_BIN /usr/bin/python2.6

# Tomcat root directory
CATALINA_HOME /usr/share/tomcat6

# DrWeb
DRWEB_ROOT_D /opt/drweb
DRWEB_ETC_D  /etc/drweb

# GnuPG binary
GPG_BIN /usr/bin/gpg

# Tar binary
TAR_BIN /bin/tar

# AWStats
AWSTATS_ETC_D /etc/awstats
AWSTATS_DOC_D /usr/share/apache2/icons/awstats

# openssl binary
OPENSSL_BIN /usr/bin/openssl

LIB_SSL_PATH /lib/libssl.so
LIB_CRYPTO_PATH /lib/libcrypto.so

CLIENT_PHP_BIN /usr/local/psa/bin/php-cli
CGI_PHP_BIN /usr/bin/php-cgi5
AWSTATS_TOOLS_D /usr/share/doc/packages/awstats/tools
AWSTATS_BIN_D   /srv/www/cgi-bin

1 comentario | Archivado como Sistemas TI | 15/01/2010

En IIS es muy recomendable ejecutar las aplicaciones PHP como FastCGI, la mejora de rendimiento es notable. Además en entornos en los que hay corriendo más de una aplicación php, esto nos permite separar los procesos facilitando la administración y aislando una aplicación de otra.

Utilizando Plesk, por defecto el panel utiliza ISAPI para ejecutar las aplicaciones y permite la elección entre CGI y FastCGI. Nuestro consejo es siempre utilizar FastCGI, a no ser que no nos quede otro remedio.

Establecer FastCGI por defecto

Hay que establecer el valor “fastcgi” en el registro:

# En el registro de Windows vamos a:

HKEY_LOCAL_MACHINESOFTWAREPLESKPSA ConfigConfig

# Y establecemos:

PLESKCP_PHP_MODE -> fastcgi

Luego vamos a la consola (cmd) y desde el directorio %plesk_dir% ejecutamos el siguiente comando para que se apliquen los cambios:

reconfigurator.exe /check=Services

Sin comentarios | Archivado como Sistemas TI | 13/01/2010