shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] apagar linhas de arquivo


From: Flavio Junior
Subject: Re: [shell-script] apagar linhas de arquivo
Date: Wed, 14 Nov 2007 09:16:14 -0200

Não entendi bem, mas veja se esse exemplo meu te ajuda:

[root@ideafix vhosts.d]# cat 00_default_vhosts.conf
# This is an example VirtualHosts configuration.
#
# Since Apache 1.3.19, we modified the setup to include some nice tricks:
#
# - We added the User and Group directives so VirtualHosts now work with
#   suexec directive. If set, Apache will run all cgi scripts under that
#   user and group (provided the uid and gid are > 100 for security). The
#   directories and cgi files *must* belong to that user/group for the
#   feature to work
#
# - We added the Setenv VLOG directive. This works in conjunction with
#   the CustomLog in common.conf. When Setenv VLOG is set, apache will
#   create a /var/log/httpd/VLOG-YYYY-MM-<ServerName>.log instead of logging
#   to access_log. Use this instead of defining a special logfile for
#   each vhost, otherwise you eat up file descriptors.
#
# - You can also specify a path for the VLOG for each Vhost, for example,
#   to place the logs in each user's directory. However, if you want to
#   use the file for accounting, place it in a directory owned by root,
#   otherwise the user will be able to erase it.
#
# - I suggest only including the ErrorLog *only* if the vhost will use
#   cgi scripts. Again, it saves file descriptors!


################# IP-based Virtual Hosts
# <VirtualHost 192.168.2.100>
# User jmdault
# Group jmdault
# DocumentRoot /home/jmdault/public_html
# ServerName test2.com
# Setenv VLOG /home/jmdault/logs
# ErrorLogs /home/jmdault/test2-error_log
# </VirtualHost>

################# Named VirtualHosts
# NameVirtualHost 111.222.33.44
# <VirtualHost 111.222.33.44>
# ServerName www.domain.tld
# ServerPath /domain
# DocumentRoot /web/domain
# </VirtualHost>

[root@ideafix vhosts.d]# sed '/^# <VirtualHost 192.168.2.100/,/^#
<\/VirtualHost>/d' 00_default_vhosts.conf
# This is an example VirtualHosts configuration.
#
# Since Apache 1.3.19, we modified the setup to include some nice tricks:
#
# - We added the User and Group directives so VirtualHosts now work with
#   suexec directive. If set, Apache will run all cgi scripts under that
#   user and group (provided the uid and gid are > 100 for security). The
#   directories and cgi files *must* belong to that user/group for the
#   feature to work
#
# - We added the Setenv VLOG directive. This works in conjunction with
#   the CustomLog in common.conf. When Setenv VLOG is set, apache will
#   create a /var/log/httpd/VLOG-YYYY-MM-<ServerName>.log instead of logging
#   to access_log. Use this instead of defining a special logfile for
#   each vhost, otherwise you eat up file descriptors.
#
# - You can also specify a path for the VLOG for each Vhost, for example,
#   to place the logs in each user's directory. However, if you want to
#   use the file for accounting, place it in a directory owned by root,
#   otherwise the user will be able to erase it.
#
# - I suggest only including the ErrorLog *only* if the vhost will use
#   cgi scripts. Again, it saves file descriptors!


################# IP-based Virtual Hosts

################# Named VirtualHosts
# NameVirtualHost 111.222.33.44
# <VirtualHost 111.222.33.44>
# ServerName www.domain.tld
# ServerPath /domain
# DocumentRoot /web/domain
# </VirtualHost>

[root@ideafix vhosts.d]#


Espero que ajude,

Flávio do Carmo Junior


On Nov 14, 2007 12:29 AM, Douglas Brito Damalio <address@hidden> wrote:
>
>
>
>
>
>
> Olá pessoal!!
>
>  eu escrevo a seguintes linhas num script shell que cria usuários ftp num
> servidor web:
>
>  echo "<VirtualHost <endereco ip>:80>" >> virtualhost.conf
>  echo "DocumentRoot \""$diretorio"\"" >> virtualhost.conf
>  echo "ServerName www."$site".<meu dominio>.br" >> virtualhost.conf
>  echo "" >> virtualhost.conf
>  echo "#Desabilita modulos de TRACE e TRACK" >> virtualhost.conf
>  echo " RewriteEngine On" >> virtualhost.conf
>  echo " RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)" >> virtualhost.conf
>  echo " RewriteRule .* - [F]" >> virtualhost.conf
>  echo " RewriteRule ^(.*).asp$ /\$1.php [L,NC]" >> virtualhost.conf
>  echo "</VirtualHost>" >> virtualhost.conf
>  echo "" >> virtualhost.conf
>  echo "/etc/init.d/httpd restart"
>
>  tenho uma função no script que remove um usuário selecionado!!
>
>  Como eu poderia remover as linhas inseridas? O problema é que as linhas que
> tem um padrão que eu utilizo são as seguintes
>
>  echo "DocumentRoot \""$diretorio"\"" >> virtualhost.conf
>
>  echo "ServerName www."$site".<meu dominio>.br" >> virtualhost.conf
>
>  Ass.: Douglas Brito Damalio
>
>  Abra sua conta no Yahoo! Mail, o único sem limite de espaço para
> armazenamento!
>  http://br.mail.yahoo.com/
>
>  [As partes desta mensagem que não continham texto foram removidas]
>
>  


reply via email to

[Prev in Thread] Current Thread [Next in Thread]