Showing posts with label Using. Show all posts
Showing posts with label Using. Show all posts

Wednesday, September 24, 2014

How to set up a squid Proxy with basic Username and Password Authentication Using NCSA

You can configure Squid to prompt users for a username and password.
Squid comes with a program called ncsa_auth that reads any NCSA-compliant encrypted password file. You can use the htpasswd program that comes installed with apache2-utils to create your passwords. Here is how it's done:

1) Create the password file. The name of the password file should be /etc/squid/squid_passwd, and you need to make sure that it's universally readable.

[root@tmp]# touch /etc/squid/squid_passwd
[root@tmp]# chmod o+r /etc/squid/squid_passwd

2) Use the htpasswd program to add users to the password file. You can add users at anytime without having to restart Squid. In this case, you add a username called www:

[root@tmp]# htpasswd /etc/squid/squid_passwd www
New password:
Re-type new password:
Adding password for user www
[root@tmp]#

3) Find your ncsa_auth file using the locate command.

[root@tmp]# locate ncsa_auth
/usr/lib/squid/ncsa_auth
[root@tmp]#

4) Edit squid.conf; specifically, you need to define the authentication program in squid.conf, which is in this case ncsa_auth. Next, create an ACL named ncsa_users with the REQUIRED keyword that forces Squid to use the NCSA auth_param method you defined previously. Finally, create an http_access entry that allows traffic that matches the ncsa_users ACL entry. Here's a simple user authentication example; the order of the statements is important:

#
# Add this to the auth_param section of squid.conf
#
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid_passwd

#
# Add this to the bottom of the ACL section of squid.conf
#
acl ncsa_users proxy_auth REQUIRED

#
# Add this at the top of the http_access section of squid.conf
#
http_access allow ncsa_users

5) This requires password authentication and allows access only during business hours. Once again, the order of the statements is important:

#
# Add this to the auth_param section of squid.conf
#
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid_passwd

#
# Add this to the bottom of the ACL section of squid.conf
#
acl ncsa_users proxy_auth REQUIRED
acl business_hours time M T W H F 9:00-17:00

#
# Add this at the top of the http_access section of squid.conf
#
http_access allow ncsa_users business_hours

Remember to restart Squid for the changes to take effect.

Monday, February 16, 2009

Update Symantec AntiVirus Corporate Edition definitions without using LiveUpdate

Update Symantec AntiVirus Corporate Edition definitions without using LiveUpdate

Question/Issue:
Your primary Symantec AntiVirus Corporate Edition server cannot automatically download virus definitions using LiveUpdate. Alternately, you want the process of downloading the daily definitions update download by hand.


Solution:
Download the attached *.vdb files.


To download an .vdb file from Symantec

  1. Go to the vdb folder on the Symantec FTP site.
  2. Click the .vdb file with the latest date, and select Save to disk from the dialog box.
  3. If the .vdb file downloads with a .zip extension, remove the .zip extension by renaming the file.
    The file name should be similar to the following:
    vd2ca005.vdb

To copy an .vdb file to a Symantec AntiVirus server
  • Copy the .vdb file to the Symantec AntiVirus program folder.
    • For NetWare servers, the default location is SYS:SAV.
    • For antivirus servers on Windows computers, the default is C:\Program Files\SAV\ for Symantec AntiVirus 8.x, or C:\Program Files\Symantec AntiVirus for Symantec AntiVirus 9.x.
The location of the folder can vary if you upgraded from a previous version.
For help with this, see the "To find the Symantec AntiVirus program folder" section in the Technical Information section of this document.

How to automatically update Symantec AntiVirus Corporate Edition definitions without using LiveUpdate

How to automatically update Symantec AntiVirus Corporate Edition definitions without using LiveUpdate

Question/Issue:
Your primary Symantec AntiVirus Corporate Edition server cannot automatically download virus definitions using LiveUpdate. Alternately, you want to automate the process of downloading the daily definitions update download by using an FTP script.


Solution:
Download and modify the attached Cegetter.bat and Cescript.txt files, and then use the Windows Task Scheduler to schedule them to download daily virus definition updates.


Notes:
  • These files are provided as an example to assist administrators with downloading the virus definitions without using LiveUpdate. Symantec does not provide technical support for these files, so use them at your own risk.

    The location of the files downloaded by these files may change, causing the updates to fail. In this case, you may need to manually edit the files to point to the new location or refer back to this document for updated versions of the attached files.
  • Cescript.txt was last updated on February 8, 2005. If you are using a previous copy of Cescript, replace it with the current file attached to this document. For additional information about recent changes to the file, read the article Cegetter.bat fails to download daily virus definitions after February 8, 2005.



Download the Cegetter.bat and Cescript.txt files.
  • You must modify the Cegetter.bat to copy definitions to the directory where Symantec AntiVirus Corporate Edition is installed on the Primary Symantec AntiVirus Server.
  • Both the Cegetter.bat and Cescript.txt should be stored on the root of the Windows boot drive on the computer where it will be executed. If Windows is installed on a drive other than C:, edit the Cescript.txt file to change the drive letter. See the section below titled "To modify the Cescript.txt file to reflect the proper drive letter."
To modify Cegetter.bat to run from the Primary Server
If you plan to schedule and execute Cegetter.bat on the Primary Server, use the following procedure. If you plan to run Cegetter.bat on a computer that is not the Primary Server, skip to the section "To modify Cegetter.bat to run from a computer that is not the Primary Server."
  1. Right-click the Cegetter.bat file, and click Edit.
  2. Find the following line in the Cegetter.bat file:

    move %systemdrive%\*.xdb
  3. If you are using Windows 2000, XP, or 2003, add the characters /y after the word move. The line should look like the following:

    move /y %systemdrive%\*.xdb

    If you are using Windows NT 4.0, do not add /y.
  4. Replace with the path to the folder in which Symantec AntiVirus Corporate Edition is installed. The default path depends on the version of Symantec AntiVirus:
    • Symantec AntiVirus Corporate Edition 8.x:
      C:\Program Files\SAV
    • Symantec AntiVirus Corporate Edition 9.x:
      C:\Program Files\Symantec AntiVirus

      If long path names are used, then make sure to enclose all path names in quotations, as shown in the Examples section.
  5. Test Cegetter.bat by executing each command, line by line, from a command prompt.
    A DOS window shows the progress of the download.
  6. Schedule Cegetter.bat to get regular definition updates. Cegetter will download the version of Navup8.exe that is released daily.

Examples
The Cegetter.bat file should appear as follows if Symantec AntiVirus Corporate Edition 8.x was installed to the default path:

ftp -s:cescript.txt
call "%systemdrive%\navup8.exe"
move %systemdrive%\*.xdb "C:\Program Files\SAV"
del /q %systemdrive%\navup8.exe


The Cegetter.bat file should appear as follows if Symantec AntiVirus Corporate Edition 9.x was installed to the default path:

ftp -s:cescript.txt
call "%systemdrive%\navup8.exe"
move %systemdrive%\*.xdb "C:\Program Files\Symantec AntiVirus"
del /q %systemdrive%\navup8.exe


To modify Cegetter.bat to run from a computer that is not the Primary Server
  1. Right-click the Cegetter.bat file, and click Edit.
  2. Find the following line in the Cegetter.bat file:

    move %systemdrive%\*.xdb
  3. If you are using Windows 2000, XP, or 2003, add the characters /y after the word move. The line should look like the following:

    move /y %systemdrive%\*.xdb

    If you are using Windows NT 4.0, do not add /y.
  4. Change to the directory where Symantec AntiVirus Corporate Edition is installed on the Primary Server. By default, this directory is shared as VPHOME.

Note: can be a mapped drive to the Primary Server or a UNC path. Symantec recommends using short file names. For example, if the server is mapped as drive x, you could use the following line:

move %systemdrive%\*.xdb x:\VPHOME

You can also specify a UNC path such as the example below, where you replace with the name or IP address of the Primary Server:

move %systemdrive%\*.xdb \\\VPHOME


To copy files into the VPHOME share, change the share permissions to allow access (Full Control) to the account that Cegetter is running under. The default permissions on that share is "Read" for "Everyone."
  1. If you are running Windows 95/98/Me, then remove the "/q" from the following line:

    del /q %systemdrive%\navup8.exe
  2. Test Cegetter.bat by executing each command, line by line, from a command prompt.
    A DOS window shows the progress of the download.
  3. Schedule Cegetter.bat to get regular definition updates. Cegetter will download the version of Navup8.exe that is released daily.

To modify the Cescript.txt file to reflect the correct drive letter
  1. Right-click the Cescript.txt file, and then click Edit.
  2. Find the following line in the Cescript.txt file:

    lcd C:\
  3. Change the C to the drive letter of the drive where Windows is installed.
  4. Save your changes.

Common problems and solutions
  • Incorrect path: Verify that the path to the directory where Symantec AntiVirus Corporate Edition is installed is correct. The file path should use short file names (DOS). If using long file names, enclose the path in quotation marks.
  • Proxy or firewall issues: If you are using a proxy or firewall that blocks FTP communications, Cegetter will not work. You must allow FTP traffic for the FTP session to succeed. If your proxy or firewall requires authentication, be sure to run the scheduled event using a user name and password that will authenticate and allow access.
  • Permissions: Verify that you can copy the .XDB file into the location on the Primary Server under the account that Cegetter is scheduled with.
  • Running under Windows 95/98/Me: A modified Cegetter.bat file is needed to run under Windows 95/98/Me. For additional information, read the document entitled Error: "File not found - C:\temp\*.vdb - 0 file(s) copied" when using Cegetter.bat to update virus definitions.
    Edit Cegetter.bat to contain the following text:

    ftp -s:cescript.txt
    choice /n/t:c,30/c:cc
    "%systemdrive%\navup8.exe"
    choice /n/t:c,30/c:cc
    move %systemdrive%\*.xdb
    del %systemdrive%\navup8.exe

Thursday, February 12, 2009

How to update Symantec AntiVirus Corporate Edition definitions without using LiveUpdate

Question/Issue:
Your primary Symantec AntiVirus Corporate Edition server cannot automatically download virus definitions using LiveUpdate.

Solution:
Download navup8.exe and *.xdb files into the location on the Primary Server., and then run navup8.exe to update virus definition. :

The default location on the Primary Server depends on the version of Symantec AntiVirus:
  • Symantec AntiVirus Corporate Edition 8.x:
    C:\Program Files\SAV
  • Symantec AntiVirus Corporate Edition 9.x:
    C:\Program Files\Symantec AntiVirus


Source:
navup8.exe: ftp://ftp.symantec.com/AVDEFS/norton_antivirus/static/navup8.exe
or
ftp://ftp.symantec.com/AVDEFS/norton_antivirus/static/

*.xdb: ftp://ftp.symantec.com/AVDEFS/norton_antivirus/xdb/

Run: Run navup8.exe to update virus definition and then remove navup8.exe. Finish.

I use Symantec AntiVirus Corporate Edition server Version 8, it's ok.

Monday, November 17, 2008

Using MEncoder to create VCD/SVCD/DVD-compliant files:

This section shows some complete commands for creating VCD/SVCD/DVD compliant videos.

1. PAL DVD

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \
-vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 \
-lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:\
keyint=15:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 25 \
-o movie.mpg movie.avi

2. NTSC DVD

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \
-vf scale=720:480,harddup -srate 48000 -af lavcresample=48000 \
-lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:\
keyint=18:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 30000/1001 \
-o movie.mpg movie.avi

3. PAL AVI Containing AC-3 Audio to DVD

If the source already has AC-3 audio, use -oac copy instead of re-encoding it.

mencoder -oac copy -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \
-vf scale=720:576,harddup -ofps 25 \
-lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:\
keyint=15:vstrict=0:aspect=16/9 -o movie.mpg movie.avi

4. NTSC AVI Containing AC-3 Audio to DVD

If the source already has AC-3 audio, and is NTSC @ 24000/1001 fps:

mencoder -oac copy -ovc lavc -of mpeg -mpegopts format=dvd:tsaf:telecine \
-vf scale=720:480,harddup -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:\
vrc_maxrate=9800:vbitrate=5000:keyint=15:vstrict=0:aspect=16/9 -ofps 24000/1001 \
-o movie.mpg movie.avi

5. PAL SVCD

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xsvcd -vf \
scale=480:576,harddup -srate 44100 -af lavcresample=44100 -lavcopts \
vcodec=mpeg2video:mbd=2:keyint=15:vrc_buf_size=917:vrc_minrate=600:\
vbitrate=2500:vrc_maxrate=2500:acodec=mp2:abitrate=224 -ofps 25 \
-o movie.mpg movie.avi

6. NTSC SVCD

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xsvcd  -vf \
scale=480:480,harddup -srate 44100 -af lavcresample=44100 -lavcopts \
vcodec=mpeg2video:mbd=2:keyint=18:vrc_buf_size=917:vrc_minrate=600:\
vbitrate=2500:vrc_maxrate=2500:acodec=mp2:abitrate=224 -ofps 30000/1001 \
-o movie.mpg movie.avi

7. PAL VCD

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xvcd -vf \
scale=352:288,harddup -srate 44100 -af lavcresample=44100 -lavcopts \
vcodec=mpeg1video:keyint=15:vrc_buf_size=327:vrc_minrate=1152:\
vbitrate=1152:vrc_maxrate=1152:acodec=mp2:abitrate=224 -ofps 25 \
-o movie.mpg movie.avi

8. NTSC VCD

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xvcd -vf \
scale=352:240,harddup -srate 44100 -af lavcresample=44100 -lavcopts \
vcodec=mpeg1video:keyint=18:vrc_buf_size=327:vrc_minrate=1152:\
vbitrate=1152:vrc_maxrate=1152:acodec=mp2:abitrate=224 -ofps 30000/1001 \
-o movie.mpg movie.avi

Using MEncoder to create VCD/SVCD/DVD-compliant files:

This section shows some complete commands for creating VCD/SVCD/DVD compliant videos.

1. PAL DVD

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \
-vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 \
-lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:\
keyint=15:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 25 \
-o movie.mpg movie.avi

2. NTSC DVD

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \
-vf scale=720:480,harddup -srate 48000 -af lavcresample=48000 \
-lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:\
keyint=18:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 30000/1001 \
-o movie.mpg movie.avi

3. PAL AVI Containing AC-3 Audio to DVD

If the source already has AC-3 audio, use -oac copy instead of re-encoding it.

mencoder -oac copy -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \
-vf scale=720:576,harddup -ofps 25 \
-lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:\
keyint=15:vstrict=0:aspect=16/9 -o movie.mpg movie.avi

4. NTSC AVI Containing AC-3 Audio to DVD

If the source already has AC-3 audio, and is NTSC @ 24000/1001 fps:

mencoder -oac copy -ovc lavc -of mpeg -mpegopts format=dvd:tsaf:telecine \
-vf scale=720:480,harddup -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:\
vrc_maxrate=9800:vbitrate=5000:keyint=15:vstrict=0:aspect=16/9 -ofps 24000/1001 \
-o movie.mpg movie.avi

5. PAL SVCD

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xsvcd -vf \
scale=480:576,harddup -srate 44100 -af lavcresample=44100 -lavcopts \
vcodec=mpeg2video:mbd=2:keyint=15:vrc_buf_size=917:vrc_minrate=600:\
vbitrate=2500:vrc_maxrate=2500:acodec=mp2:abitrate=224 -ofps 25 \
-o movie.mpg movie.avi

6. NTSC SVCD

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xsvcd  -vf \
scale=480:480,harddup -srate 44100 -af lavcresample=44100 -lavcopts \
vcodec=mpeg2video:mbd=2:keyint=18:vrc_buf_size=917:vrc_minrate=600:\
vbitrate=2500:vrc_maxrate=2500:acodec=mp2:abitrate=224 -ofps 30000/1001 \
-o movie.mpg movie.avi

7. PAL VCD

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xvcd -vf \
scale=352:288,harddup -srate 44100 -af lavcresample=44100 -lavcopts \
vcodec=mpeg1video:keyint=15:vrc_buf_size=327:vrc_minrate=1152:\
vbitrate=1152:vrc_maxrate=1152:acodec=mp2:abitrate=224 -ofps 25 \
-o movie.mpg movie.avi

8. NTSC VCD

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xvcd -vf \
scale=352:240,harddup -srate 44100 -af lavcresample=44100 -lavcopts \
vcodec=mpeg1video:keyint=18:vrc_buf_size=327:vrc_minrate=1152:\
vbitrate=1152:vrc_maxrate=1152:acodec=mp2:abitrate=224 -ofps 30000/1001 \
-o movie.mpg movie.avi