Windows:1.8
From AnopeWiki
Contents |
Anope will NOT run on Windows 98/ME or Below, or Windows NT 4 or Below
There are two ways of running Anope on Windows, downloading the precompiled version (recommended) or compiling your own version of Anope.
Precompiled Version
- Download the required precompiled executable (with or without MySQL) from our Anope Sourceforge Repository
- Install Anope
- Install Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)
- Locate the installation directory (normally C:\Program Files\Anope)
- Rename the example.conf to services.conf and configure it to your suiting
- Configure your IRCd's config file and /rehash
- Run anope and check for errors on IRC / Log files
Compiling
For information on compiling Anope BEFORE version 1.7.14.1061, see Windows:OldCompileMethod
- Download the Anope source code tar.gz from our Anope Sourceforge Repository
- If you have Microsoft Visual Studio .NET you can skip this step otherwise, install the following software:
- Microsoft Visual C++ 6 or Above or Microsoft Visual C++ 2005 Express Edition
- Microsoft PlatformSDK [WGA Validation is required]. (During install, select Custom and then the top and bottom groups only - saves download time)
- MySQL (if you wish to build with MySQL compatibility)
- Unpack Anope Source Code to a location on your hard disk. (We suggest C:\Program Files\Anope)
- Open the Visual Studio Command Prompt (NOT A DOS BOX), and change directory to the location of your extracted Anope Source Code
- At the prompt type cscript /nologo install.js (And answer the questions).
- At the prompt type nmake -f makefile.win32
- Locate your anope directory
- Rename the example.conf to services.conf and configure it to your suiting
- Configure your IRCd's config file and /rehash
- Run anope and check for errors on IRC / Log files
Troubleshooting
If you are unsure of the settings, you can go to the dos command prompt and run "anope.exe -nofork -debug" and watch the information as it attempts to connect. You can launch services in two ways. If you are sure that the entered configuration information is correct, simply double clicking the Anope executable will cause it to start; no window will pop up. If you'd rather have a more textual output, you can start at the dos prompt and type in "anope.exe". If services are successfully started up the dos prompt will seem to hang; at this point you can safely close the dos window.
Modules
Windows:Modules has all the information on what to do and how to use modules with Anope for Windows.
MySQL
- Copy libmysql.dll to c:\windows\system32\, or ensure it's in a directory in your PATH variable, or in the same folder as Anope. The pre-compiled version of Anope is built against the latest stable MySQL branch at the time - currently 5.0.
- Find and change:
- MysqlHost "localhost" - This needs to be the host or IP address of your MySQL server. If it's on the same machine, you can leave this as localhost.
- MysqlUser "username" - This needs to be the user that has access to your database.
- MysqlPass "password" - The password assosiated with the MySQL user defined above.
- MysqlName "anope" - This needs to be the name of the database that Anope will use. All tables have anope_ as their prefix by default.
- #MysqlSock "/tmp/mysql.sock" - You won't need to uncomment or define this when running Anope on Windows.
- #MysqlPort 3306 - If you run MySQL on a port other than 3306, you'll need to change this line as required.
- Import the tables.sql file that came with Anope into your MySQL database. This can be done via a web-interface, or by issuing the following command in a command prompt window, inside the bin folder of your MySQL installation:
mysql --user=<value of MysqlUser> --pass <value of MysqlName> < "c:\program files\anope\data\tables.sql"
- Now, either start or restart Anope and MySQL should now be in use. If you want to have Anope read from the SQL database on startup too (NOTE: This could cause a slight delay on loading), you'll need to uncomment the UseRDB option in services.conf.
If MySQL is not enabled, check your logs for any error messages. Also ensure you are using a version of Anope with MySQL enabled. If you are still having problems, check out the Forums or ask in our support channel.
Anope as service
NOTE: The following is an unofficial solution to the Anope as a service problem. In future versions of Anope (possibly 1.7.20 or later) an option will be included with the Installer that offers this. This solution will be different from that listed below. The following is offered as a temporary solution, but is in no way supported by the Anope Team.
- Download the Windows Resource Kit and install it link
- At a command prompt window, type the following command: path\INSTSRV.EXE Anope path\SRVANY.EXE (Where path is the drive and directory of the Windows Resource Kit - for example, C:\RESKIT - and Anope is the name of the service you are creating).
Example:
C:\Program Files\Windows Resource Kit\Tools\Instsrv.exe Anope C:\Program Files\Windows Resource Kit\Tools\Srvany.exe
NOTE: To verify that the service was created correctly, check the registry to verify that the ImagePath value under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\service name is set to point to SRVANY.EXE. If this is not set correctly, the service will stop shortly after it starts and return an Event ID 7000 "The service name failed to start."
- Run Registry Editor (Regedt32.exe)and locate the following subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Anope
- From the Edit menu, click Add Key. Type the following and click OK:
Key Name: Parameters Class : <leave blank>
- Select the Parameters key.
- From the Edit menu, click Add Value. Type the following and click OK:
Value Name: Application Data Type : REG_SZ String : C:\Program Files\Anope\anope.exe
- Select the Parameters key again.
- From the Edit menu, click Add Value. Type the following and click OK:
Value Name: AppDirectory Data Type : REG_SZ String : C:\Program Files\Anope\
- Close Registry Editor
- Start anope from the Services applet in Control Panel or from a MS-DOS command prompt, type the following:
NET START Anope

